-
Notifications
You must be signed in to change notification settings - Fork 227
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
fix(infrastructure): unit test code coverage for typescript #487
Conversation
This reverts commit d486cef.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left some comment just to clarify my understanding, but LGTM!
@@ -24,11 +24,11 @@ module.exports = { | |||
// preprocess matching files before serving them to the browser | |||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | |||
preprocessors: { | |||
'test/unit/index.tsx': ['webpack'], | |||
'test/unit/index.tsx': ['webpack', 'sourcemap'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does sourcemap
do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you get minified or transpiled code (like things generated by ts-loader and babel-loader), its difficult to read when debugging. Sourcemaps provide a way for the browser to show the developer the original code (or at least readable). :)
enforce: 'post', | ||
test: /\.(js|ts)x?$/, | ||
use: { | ||
loader: 'istanbul-instrumenter-loader', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that we're using istanbul-instrumenter-loader
now instead of the istanbul
webpack plugin, is that correct? can we remove istanbul
from the package.json or does the loader require it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
istanbul-instrumenter-loader
requires istanbul
...like when create-react-app requires node-sass
when you want to use sass.
We needed to switch it because we the istanbul webpack plugin does not work with typescript.
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
related #48
This took me a long time to find. But basically my issue was
karma-coverage
does not work withistanbul-instrumenter-loader
. Solution/Issue is documented on webpack-contrib/istanbul-instrumenter-loader#32. This github issue led me to usingkarma-coverage-istanbul-reporter
instead, which is a fork of karma-coverage.