Skip to content
This repository has been archived by the owner on Oct 26, 2018. It is now read-only.

Commit

Permalink
Combine browser and node coverage reports
Browse files Browse the repository at this point in the history
  • Loading branch information
ellbee committed Nov 27, 2015
1 parent a78e3cc commit b5e7b77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
15 changes: 4 additions & 11 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ module.exports = function (config) {
if (runCoverage) {
coverageLoaders.push({
test: /\.js$/,
include: path.resolve('modules/'),
exclude: /__tests__/,
include: path.resolve('src/'),
loader: 'isparta'
})
}),

coverageReporters.push('coverage');
}
Expand Down Expand Up @@ -42,17 +41,11 @@ module.exports = function (config) {
{
test: /\.js$/,
exclude: [
path.resolve('src/'),
path.resolve('node_modules/')
],
loader: 'babel'
},
{
test: /\.js$/,
include: path.resolve('src/'),
loader: 'isparta'
}
]
].concat(coverageLoaders)
}
},

Expand All @@ -63,7 +56,7 @@ module.exports = function (config) {
coverageReporter: {
reporters: [
{ type: 'text' },
{ type: 'html', subdir: 'html' }
{ type: 'json', subdir: 'browser-coverage', file: 'coverage.json' }
]
}
});
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
"build": "mkdir -p lib && babel ./src/index.js --out-file ./lib/index.js",
"test": "mocha --compilers js:babel-core/register --recursive",
"test:browser": "karma start",
"test:cov": "babel-node $(npm bin)/isparta cover $(npm bin)/_mocha -- --recursive",
"test:cov": "npm run test:cov:browser && npm run test:cov:node && npm run test:cov:report",
"test:cov:node": "babel-node $(npm bin)/isparta cover $(npm bin)/_mocha report --dir ./coverage/node-coverage -- --recursive",
"test:cov:browser": "COVERAGE=true karma start",
"test:cov:report": "$(npm bin)/istanbul report --dir ./coverage --include **/*coverage.json html text",
"prepublish": "npm run build"
},
"tags": [
Expand Down

0 comments on commit b5e7b77

Please sign in to comment.