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
We can instrument the webpack build by adding transpile options to coffee-loader so that it will use babel-plugin-istanbul. However, when I tried this, the build silently failed.
Once the code is instrumented, we still need to pull it out of the browser environment.
At that point, we can generate the output we want using nyc.
Finally, we need to add a stanza to .gitignore so we don't commit the coverage reports.
The options I tried with coffee-loader look like this:
which, again, just silently failed to produce an output file. (The silence is likely due to the fact that I'm not checking the response object from Webpack.)
The .gitignore stanza:
# Istanbul
coverage/
.nyc_output
The text was updated successfully, but these errors were encountered:
The rationale: we're relying on scenario-based functional tests instead of unit tests (because it's difficult to test many mixins and combinators in isolation), so being able to see coverage is even more valuable than it would be otherwise. We could of course also adapt this approach for use with other projects.
I added error logging and this is how Webpack is failing:
CoffeeScriptError: TypeError: Cannot read property 'endsWith' of undefined
I searched for this but didn't find much. It appears to be coming from the CoffeeScript compiler, but there's nothing in the CoffeeScript code that uses that. And, of course, it compiles fine without the use of Babel. So it's probably related to Babel, but I didn't test any farther than that.
I attempted to make some headway on this but it's a bit of rabbit hole. So here's what I've figured out.
coffee-loader
so that it will usebabel-plugin-istanbul
. However, when I tried this, the build silently failed.nyc
..gitignore
so we don't commit the coverage reports.The options I tried with
coffee-loader
look like this:which, again, just silently failed to produce an output file. (The silence is likely due to the fact that I'm not checking the response object from Webpack.)
The
.gitignore
stanza:The text was updated successfully, but these errors were encountered: