-
Notifications
You must be signed in to change notification settings - Fork 11.9k
feat (CodeCoverage): use karma-remap-istanbul #1468
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
Changes from 5 commits
803fa36
b444648
c76046f
4c49c59
ce175e3
40c5b88
cdebee1
b0d7618
b460f24
66ff31f
7297a13
3ed174b
5fae7f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,8 @@ module.exports = function (config) { | |
require('karma-jasmine'), | ||
require('karma-chrome-launcher'), | ||
require('karma-coverage'), | ||
require('angular-cli/plugins/karma') | ||
require('angular-cli/plugins/karma'), | ||
require('karma-remap-istanbul') | ||
], | ||
customLaunchers: { | ||
// chrome setup for travis CI using chromium | ||
|
@@ -22,10 +23,34 @@ module.exports = function (config) { | |
{ pattern: './src/test.ts', watched: false } | ||
], | ||
preprocessors: { | ||
'./src/**/**/*.ts': ['angular-cli-coverage'], | ||
'./src/test.ts': ['angular-cli'] | ||
}, | ||
coverageReporter: { | ||
dir: 'coverage', | ||
reporters: [ | ||
{ | ||
type: 'text-summary' | ||
}, | ||
{ | ||
type: 'json', | ||
subdir: '.', | ||
file: 'coverage-final.json' | ||
} | ||
] | ||
}, | ||
|
||
|
||
remapIstanbulReporter: { | ||
src: 'coverage/coverage-final.json', | ||
reports: { | ||
lcovonly: 'coverage/lcov.info', | ||
html: 'coverage/report' | ||
}, | ||
timeoutNotCreated: 5000, | ||
timeoutNoMoreFiles: 1000 | ||
}, | ||
angularCliConfig: './angular-cli.json', | ||
reporters: ['coverage', 'progress'], | ||
reporters: ['coverage', 'progress', 'karma-remap-istanbul'], | ||
port: 9876, | ||
colors: true, | ||
logLevel: config.LOG_INFO, | ||
|
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.
Would you be willing to explain this?
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.
I added a new preprocessor in the karma plugin. While there is a single entry point for the tests in order to get the remap plugin to generate the mapped coverage report it needs to run over the test files themselves.