How to exclude vendor directory from test coverage?
https://deno.land/manual@v1.25.4/testing/coverage
Here it says by default it will exclude
test\.(ts|tsx|mts|js|mjs|jsx|cjs|cts)
and only include specifiers matching ^file:
. If I wanted to keep the current behavior but also exclude my vendor directory how would I do that?
Before this I tried excluding them from codecov by using the following codecov.yml
in my .github
directory but it didn't work and still shows coverage for my vendor directory.
Here is the documentation where it says how to ignore paths in codecov. I've also tried just doing vendor
but that didn't work either.
https://docs.codecov.com/docs/ignoring-paths
Since I couldn't get codecov to ignore it correctly, I want to try getting deno coverage to instead.Codecov
Ignoring Paths
You can use the top-level ignore: key to tell Codecov to ignore certain paths. Add a list of paths (folders or file names) to your codecov.yml file under the ignore key to exclude files from being collected by Codecov. Ignored files will be skipped during processing. The following are examples of di...
7 Replies
pretty sure codecov has nothing to do with denos coverage algo
yea, but codecov uploads the coverage files. If I can get deno to not generate coverage files for my vendor directory, I won't have this problem of codecov showing coverage for that directory.
did you try --exclude?
else i think its impossible for vendored files
as they are not remote
you could upload you vendored files but this kinda defeats the purposes of vendored files
I want to but it says that would override the default. I want to add exclusions rather than replace the default exclusion/inclusions. The manual says the following.
I'm going to try
deno coverage --exclude="(test\.(ts|tsx|mts|js|mjs|jsx|cjs|cts)|^vendor/.*|^public/.*)" --lcov cov > cov.lcov
but it's a bit ugly. Would be great if the manual were updated to include examples.
nope, looks like that didn't work.no you need to do it from deno test
not deno coverage i think
It says that about the coverage command though.
I went ahead and created an issue for this on denoland/manual.
https://github.com/denoland/manual/issues/406
GitHub
Add example for excluding vendored dependency from
deno coverage
...The manual page for testing coverage mentioned that there are default inclusions/exclusions and that if you add either of those flags it would override those defaults. However it doesn't sh...