This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
Add sourcemap support for coverage by using remap-istanbul #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added remap-istanbul and all supporting karma plugins to correctly
remap the coverage results back to their TypeScript source.
Since all generations happens in memory by Webpack, we needed inline
sourcemap support, provided by the Karma plugins, the Webpack devtool
setting, and the webpack typescript loader.
The normal
ts-loader
doesn't support inline sourcemaps, so we switchedto
awesome-typescript-loader
. We created a newtsconfig.test.json
that is the same as the normal
tsconfig.json
but enables inlinesourcemaps by adding
"inlineSourceMap": true
.The webpack dist builds have also switched to
awesome-typescript-loader
to keep the configuration consistent.
To make the
awesome-typescript-loader
correctly work with const enums,we needed to enable
preserveConstEnums
property in thetsconfig.json
.We also switched he
test/index.js
toindex.ts
and includedwebpack-env
in thetypings.json
so all wepack requires work inTypeScript.
To have correct coverage reports consisting of all the source files,
we've added a
Dummy.ts
file in thesrc/
folder that is notreferenced by any tests, but must show up in the coverage results.
If this is not the case, we know our test setup is incorrect.
re #15