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
So I have a bit of a unique set-up in that my library is an integration for both webpack and browserify. I use istanbul-instrument-loader and babel-plugin-istanbul to instrument each, respectively. It seems like my worker is being instrumented and my test code instantiates the worker, but I get coverage for everything except the worker. The webworkify function I export also has no reported coverage.
You can view the code at agilgur5/physijs-webpack#cypress-coverage. It's pretty tiny, basically just webpack.js, browserify.js, and browserify-worker-stub.js, which are all ~5-10 LoC, and their two 5 LoC tests (everything in the physijs/ directory is for the most part just vendored and can mostly be ignored).
Can install, test, and see coverage with:
npm install && npm test && npx nyc report
Notably, physi_worker.js isn't present in the coverage report, and browserify-worker-stub.js shows no coverage for the function it exports (which is called by webworkify), despite tests running the worker.
As this is an integration library, it'd be ideal to know that physijs (the library it integrates) itself isn't broken due to the integration, so high code coverage of it would give some confidence that nothing has broken.
I'm not totally sure if this is happening because of an istanbul issue or a cypress issue. When I ran the worker as a fake worker (i.e. on the same thread) in jsdom with jsdom-worker, I did get coverage for it. So I wonder if the reason it's not showing up in cypress's coverage reports is because it's running in a real worker. (Can read agilgur5/physijs-webpack#6 for more details on how I tried to get coverage to work with all sorts of different toolks, but it shouldn't be necessary to understand this issue)
The text was updated successfully, but these errors were encountered:
So I have a bit of a unique set-up in that my library is an integration for both
webpack
andbrowserify
. I useistanbul-instrument-loader
andbabel-plugin-istanbul
to instrument each, respectively. It seems like my worker is being instrumented and my test code instantiates the worker, but I get coverage for everything except the worker. Thewebworkify
function I export also has no reported coverage.You can view the code at agilgur5/physijs-webpack#cypress-coverage. It's pretty tiny, basically just
webpack.js
,browserify.js
, andbrowserify-worker-stub.js
, which are all ~5-10 LoC, and their two 5 LoC tests (everything in thephysijs/
directory is for the most part just vendored and can mostly be ignored).Can install, test, and see coverage with:
Notably,
physi_worker.js
isn't present in the coverage report, andbrowserify-worker-stub.js
shows no coverage for the function it exports (which is called bywebworkify
), despite tests running the worker.As this is an integration library, it'd be ideal to know that
physijs
(the library it integrates) itself isn't broken due to the integration, so high code coverage of it would give some confidence that nothing has broken.I'm not totally sure if this is happening because of an
istanbul
issue or acypress
issue. When I ran the worker as a fake worker (i.e. on the same thread) injsdom
withjsdom-worker
, I did get coverage for it. So I wonder if the reason it's not showing up incypress
's coverage reports is because it's running in a real worker. (Can read agilgur5/physijs-webpack#6 for more details on how I tried to get coverage to work with all sorts of different toolks, but it shouldn't be necessary to understand this issue)The text was updated successfully, but these errors were encountered: