D
Deno

help

Is there a way to get deno coverage information in a vscode lens?

Jjcayzac12/15/2023
If I run my tests with coverage enabled, can I get some visual feedback in vscode?
DAHDeno AI Helper12/15/2023
I wasn't able to find the answer to your question in the official Deno documentation. As of my last update, there isn't a specific Deno feature or extension that provides test coverage information directly in VSCode as a CodeLens. However, if you're looking for visual feedback on your test coverage in VSCode, you might consider generating a coverage report using Deno's built-in coverage tools and then using a generic code coverage visualization tool that supports the output format provided by Deno. To generate a coverage report with Deno, you would typically run your tests with coverage enabled like this:
deno test --coverage=./coverage
deno test --coverage=./coverage
After running your tests, you can convert the coverage data to a more common format like lcov:
deno coverage ./coverage --lcov > coverage.lcov
deno coverage ./coverage --lcov > coverage.lcov
Then, you could use a VSCode extension that supports lcov reports, such as "Coverage Gutters", to visualize the coverage in your editor. Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of this advice and the compatibility of any VSCode extensions with Deno's coverage output.
Jjcayzac12/15/2023
Code Coverage - Visual Studio Marketplace
Extension for Visual Studio Code - Boost test coverage and reliability with this easy-to-use code coverage analysis tool
Jjcayzac12/15/2023
Hmmm… What does it mean that the highlighted line is missing coverage? It's just a closing brace.
No description
JHJoe Hildebrand12/15/2023
That one probably means the else of that if wasn't covered. I think may be a couple off-by-ones in the coverage info, particularly around branches. I'll bet it's in the generated TS sourcemaps, but I can't prove it until I isolate some test cases.
Jjcayzac12/15/2023
Thanks! I wish I could generate coverage when I run tests from the code lens…
JHJoe Hildebrand12/15/2023
Me too. I also wish debugging was easier from there.
Jjcayzac12/15/2023
Right. Debugging stuff in the js runtime of Deno was a nightmare tbh. I spent hours on a trivial issue I only found after I just injected debug information in the global scope so I could inspect things by running the generated deno binary…… (turns out object keys are always coerced to strings even if they're numbers, duh 😄 )
JHJoe Hildebrand12/15/2023
(you almost certainly know this, but use a Map if you want numbers, and wait patiently for https://github.com/tc39/proposal-record-tuple so that both Map and Set are actually useful one day)
GitHub
GitHub - tc39/proposal-record-tuple: ECMAScript proposal for the Re...
ECMAScript proposal for the Record and Tuple value types. | Stage 2: it will change! - GitHub - tc39/proposal-record-tuple: ECMAScript proposal for the Record and Tuple value types. | Stage 2: it w...
Bbartlomieju12/16/2023
FYI @kt3k is investigating problems with coverage - there's something wrong with source maps being applied and that's why you see these strange uncovered lines Can you open an issue about it? Seems like adding an option to capture coverage from a code lens shouldn't be too hard Could you open an issue for that too? Debugging is really important to us, so if something is not easy to do we will address it
Jjcayzac12/20/2023
Sure! https://github.com/denoland/vscode_deno/issues/1018 Which repo should I create that one in? The main repo, right? Edit: https://github.com/denoland/deno/issues/21652

Looking for more? Join the community!

Recommended Posts
Performance QuestionI have a Deno application, which creates API endpoint, and uses mongodb. Now I want to host this on Is there a way to get a server's SSL certificate's public information with Deno?This is available in Node with `getPeerCertificate()` but not in Deno's Node compatibility layer - iInvalidData: No certificates found in cert fileHello! Following up from a previous help post here, https://discord.com/channels/684898665143206084/Cannot use deno prompt when in windows CMDIt only works in the VSCode integrated terminal? I have added some output around the run command, buStreaming large files with fetch and FormDataHi, I'm trying to find a way to build multiplart/form-data requests in Deno that contain large filesIf I want to integrate a fully featured Deno runtime into my application, where do I start?I want to create a scripting environment for my application that will enable people to create customTrying to deploy a project on Deno Deploy with a private Github repository dependencyBy reading the docs at https://docs.deno.com/runtime/manual/basics/modules/private I found that I caHow can I make sure the code gets run on the client-side??!```tsx import { useEffect, useState } from "preact/hooks"; export default function Callback() { VSCode + Deno + Vite + TypescriptJust setup a project with `create-vite-extra` but all the starter files are full of typescript errorMemory LimitHello guys, in some situations i'am receiving one of the following error message `dd-hard-memory-limGoogle CalendarHi! I am looking for a minimal example how to access google calendar API. I already obtained credenI can't access my deno cloud github accountPlease help, by mistake I converted my personal github account to an organization account, and now IUploaded a module, need help!I uploaded my module: https://deno.land/x/vipps_mobilepay_sdk@0.0.1 But then I realised that I shoulBetter way of finding element from mapIm making an api and all routes are stored in a map. is there a better and more optimised way to loodeno info depthhow do i limit maximum output depth for `deno info` command? for example, it's easier to analyze verDate libraryCan anyone recommend a decent working date library for deno? All the ones I'm trying (datefns, dayjsawait writer.write(buffer) never resolves on Deno.CommandHiho. I'm creating a `Deno.Command` that writes a buffer to `vipsthumbnail` via stdin (and reads theNot sure if I understand kv watch right?Not sure if I understand kv watch right, is like named queues? o more like a reliable Broadcast chanDisplaying a ModalI am trying to get a minimal example of using Bootstrap Modals, and managing that modal using state.How do I run an npm script with multiple dependencies, e.g. `drizzle-kit generate:pg`?I thought about wrapping it into a task `"generate": "deno run -A npm:drizzle-kit generate:pg"` in t