You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using rollup to bundle a library I'm working on, using ES2015 import/export. My current test approach is to bundle my tests along with the code under test:
This allows me to run the tests under Node, and use nyc like so:
nyc --clean -x 'test/**' node dist/test.js
The test coverage shows that the sourcemaps are recognized and used - the coverage is broken out properly by source file. However, the -x/--exclude param is not properly excluding tests or other files I want to exclude, and these show up in the coverage report. I have tried every glob combination of test/**/test/**, ./test/**, etc with no effect. I have also tried putting include/exclude in the "nyc" stanza of package.json.
If I specify --include='lib/**', I get no coverage at all, but --include='dist/test**' works, and shows me the mapped files, so include at least is being processed relative to the filesystem. Using -x 'dist/test**' --include='dist/test**' gives me no coverage at all. So it's pretty certain that --exclude is being processed relative to the filesystem as well, regardless of how I set --exclude-after-remap.
Is my test-bundling approach incorrect?
Is there a CLI option I've overlooked here?
Apologies if this is user error rather than a bug, but it seems that --exclude is not working as expected in this case.
The text was updated successfully, but these errors were encountered:
I'm using
rollup
to bundle a library I'm working on, using ES2015import
/export
. My current test approach is to bundle my tests along with the code under test:This allows me to run the tests under Node, and use
nyc
like so:The test coverage shows that the sourcemaps are recognized and used - the coverage is broken out properly by source file. However, the
-x
/--exclude
param is not properly excluding tests or other files I want to exclude, and these show up in the coverage report. I have tried every glob combination oftest
/**/test/**
,./test/**
, etc with no effect. I have also tried puttinginclude
/exclude
in the"nyc"
stanza of package.json.If I specify
--include='lib/**'
, I get no coverage at all, but--include='dist/test**'
works, and shows me the mapped files, soinclude
at least is being processed relative to the filesystem. Using-x 'dist/test**' --include='dist/test**'
gives me no coverage at all. So it's pretty certain that--exclude
is being processed relative to the filesystem as well, regardless of how I set--exclude-after-remap
.Apologies if this is user error rather than a bug, but it seems that
--exclude
is not working as expected in this case.The text was updated successfully, but these errors were encountered: