reed
reed•8mo ago

Missing transpiled source code

I'm trying to generate coverage for my project and I'm getting the following:
deno task coverage
Task coverage deno coverage --html ./coverage
error: Missing transpiled source code for: "file:///Users/reed/code/fresh_ga4/deps.ts".
Before generating coverage report, run `deno test --coverage` to ensure consistent state.
deno task coverage
Task coverage deno coverage --html ./coverage
error: Missing transpiled source code for: "file:///Users/reed/code/fresh_ga4/deps.ts".
Before generating coverage report, run `deno test --coverage` to ensure consistent state.
This is after successfully testing via deno test -A --coverage. What am I doing wrong?
2 Replies
Deno AI Helper
Deno AI Helper•8mo ago
It seems like you've encountered an issue where the coverage data is not aligning with the source code when you try to generate the coverage report. According to the documentation, Deno collects test coverage into a directory if you specify the --coverage flag when starting deno test. After running the tests, you should process the coverage data immediately to ensure consistent results, as the source code and collected coverage data might get out of sync and unexpectedly show uncovered lines. Here's a step-by-step approach to ensure you're doing it correctly: 1. Run your tests with the --coverage flag to collect coverage data:
deno test -A --coverage=./cov

deno test -A --coverage=./cov

This command will run the tests with all permissions and collect coverage information into the ./cov directory. 2. After running the tests, immediately process the coverage data:
deno coverage --html ./cov

deno coverage --html ./cov

This command will process the coverage data from the ./cov directory and generate an HTML report. Make sure you are not modifying any files between running the tests and generating the coverage report, as this could cause the data to get out of sync. If you follow these steps and still encounter the issue, it might be a good idea to check if all files, including deps.ts, are being included in the coverage data and that no relevant files are being excluded by any patterns or configurations. If the problem persists, you might want to double-check the paths and ensure that the coverage directory specified after --coverage in the test command and the one used in the deno coverage command are the same. 🦕
reed
reed•8mo ago
not helpful. this is just the information from the documentation, which i've obviously followed