Skip to content
This repository was archived by the owner on Aug 27, 2020. It is now read-only.

fix coverage for typescript (karma-remap-coverage) #5

Merged
merged 1 commit into from
Apr 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"karma-coverage": "^1.1.1",
"karma-mocha": "^1.3.0",
"karma-phantomjs-launcher": "^1.0.2",
"karma-remap-coverage": "^0.1.4",
"karma-sinon-chai": "^1.2.4",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "0.0.26",
Expand Down
13 changes: 7 additions & 6 deletions template/test/unit/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = function (config) {
// 2. add it to the `browsers` array below.
browsers: ['PhantomJS'],
frameworks: ['mocha', 'sinon-chai'],
reporters: ['spec', 'coverage'],
reporters: ['spec', 'coverage', 'remap-coverage'],
files: ['./index.{{#if_eq compiler "typescript"}}ts{{else}}js{{/if_eq}}'],
preprocessors: {
'./index.{{#if_eq compiler "typescript"}}ts{{else}}js{{/if_eq}}': ['webpack', 'sourcemap']
Expand All @@ -23,11 +23,12 @@ module.exports = function (config) {
noInfo: true{{#if_eq eslintConfig "airbnb"}},{{/if_eq}}
},
coverageReporter: {
dir: './coverage',
reporters: [
{ type: 'lcov', subdir: '.' },
{ type: 'text-summary' }{{#if_eq eslintConfig "airbnb"}},{{/if_eq}}
]
type: 'in-memory'{{#if_eq eslintConfig "airbnb"}},{{/if_eq}}
},
remapCoverageReporter: {
'text-summary': null,
lcov: './test/unit/coverage/lcov',
html: './test/unit/coverage/html'{{#if_eq eslintConfig "airbnb"}},{{/if_eq}}
}{{#if_eq eslintConfig "airbnb"}},{{/if_eq}}
}){{#if_eq eslintConfig "airbnb"}};{{/if_eq}}
}{{#if_eq eslintConfig "airbnb"}};{{/if_eq}}