Missing transpiled source code
I'm trying to generate coverage for my project and I'm getting the following:
This is after successfully testing via
deno test -A --coverage
. What am I doing wrong?2 Replies
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:
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:
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. 🦕not helpful. this is just the information from the documentation, which i've obviously followed