-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Strategies for more accurate code coverage report #558
Comments
It seems like there are ways to compose the sourcemaps. LIke sourcemap to ES6 source map again to Babel. |
That seems quite feasible solution. I'll try to look for some references. |
Spend some time and could able to list up some options. using
|
Order of personal preference is 1.gulp 2.multi-stage-sourcemap (inline source map with babel is out of option for me). Of course using gulp will require additional effort to replace existing npm based build scripts, but it'll bring some additional side effect of better windows support (specifically dealing with cross-platform environment variable, file glob) along with streamlined source map support using ready made plugin. Build script for current repo is not yet very complex, so it won't require huge effort to create new scripts for build compare to create new script for source map conversion via multi-stage-sourcemap module (and I'm willing to take this effort if it's going to happen). Thoughts? or any other suggestions for tooling support would be appreciated. |
After give few more try, seems |
…inal typescript code closes ReactiveX#558
…inal typescript code closes ReactiveX#558
…inal typescript code closes ReactiveX#558
Related with PR #557
Current code coverage report (i.e, build 823) is indicating coverage of source points to transpiled results from original typescript based sources. Due to this reason it does not reports accurate coverage percentage also does not allows navigation to coverage detail, makes bit hassle to triage when coverage number goes down.
Coverage report shows coverage against transpiled
Not able to navigate actual source detail
PR #557 partially resolves this issue by enabling coverage remapping via sourcemaps. Still it doesn't give right coverage to original source but es6 transpiled source because of current build mechanism,
since test cases are using commonjs output from 2, even after enabling sourcemap remapping coverage report shows result against ES6 output from 1 instead of original source doesn't give right accuracy of test coverage along with lacks of navigation. (example report can be found at here)
source map enabled
detail's still not available
Could think of few options to resolve this issues,
1. build commonjs module via typescript compiler: Not considerable due to #248
2. leave current build mechanism as-is, build commonjs module once again via typescript compiler only for test coverage: Though this can work, still bit hacky since it requires build couple, or triple for same build.
3. it's ok to live with current coverage status, let's leave as-is.4. Maybe some other way I couldn't think of
I have tried option 2, could create test coverage shows quite different number than what we're currently having against transpiled results. (example report can be found at here)
Ideal coverage report, shows accurate coverage to source
detailed navigation is available
Personally though it's bit hacky way, would like to suggest 2. (rebuild cjs via tsc only for coverage), does not hurt actual output also get detailed coverage to actual code.
Update: disposed above options by looking composing sourcemap as hinted.
The text was updated successfully, but these errors were encountered: