-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add code coverage #6
Comments
Started working on this because we have tests so code coverage really makes sense to have too. It turns out There isn't much documentation on source map support for |
Added a
First made me think the problem would be in I also realized users of this library trying to test their own code are going to run into similar issues with workers etc welp welp 😕 😞 |
- also output source map files for nyc to use - (deps): add exorcist to browserify for this - FIXME: currently bugging out: - browserify is not reading source maps or build folder at all? - webpack is reading source maps, but isn't excluding physi.js files
- jest's coverage reporting only knows how to use inline source maps, so make them output as inline instead of external .map files - can remove exorcist now since inline source maps are built-in to browserify FIXME: jest --coverage on browserify.spec.js runs into an infinite loop - likely bc it's relying on istanbul-lib-instrument and running it on ammo and failing spectacularly -- need it to ignore ammo code FIXME: webpack passes like with nyc but ignores nothing... :/
Ok so I spent far far far far too long trying to figure this out and still failed to get it to work correctly... The source map ignore stuff I'm pretty sure is a bug in some part of That being said, I think I narrowed down the issues:
|
- instrument the code with istanbul and output usage into .nyc_output - add nyc to create coverage reports with the data in .nyc_output - output sourcemaps with browserify and webpack - FIXME: this doesn't seem to change anything????
- instrument the code with istanbul and output usage into .nyc_output - add nyc to create coverage reports with the data in .nyc_output - output sourcemaps with browserify and webpack - FIXME: this doesn't seem to change anything???? FIXME: physijs_worker.js doesn't appear in coverage reports at all
Now that #5 adds a test harness, runner, and some tests, it should be simple to just add some code coverage. It'll have to be customized a bit to ignore mostly vendored code, i.e.
physi.js
,physijs_worker.js
, andammo.js
(though there's not much code left after that 😅 ). Here's how to exclude/include withnyc
.I just started looking into it and realized a pretty big problem -- the tests import the bundled code, not the source code, so without some likely quite hacky source mapping, it's probably not possible to actually get coverage numbers for source code.
But the non-vendored code basically doesn't branch and is quite tiny, so nbd either way in all honesty.
The text was updated successfully, but these errors were encountered: