Skip to content
This repository has been archived by the owner on Feb 8, 2019. It is now read-only.

Commit

Permalink
⭐ new: coveralls setup
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Jun 12, 2016
1 parent 7170397 commit a7cfca0
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
7 changes: 6 additions & 1 deletion meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ module.exports = {
type: 'confirm',
message: 'Setup e2e tests?'
},
coveralls: {
type: 'confirm',
message: 'Setup coveralls?'
},
sauce: {
type: 'confirm',
message: 'Setup sauce tests?'
Expand Down Expand Up @@ -75,9 +79,10 @@ module.exports = {
filters: {
"examples/**/*": 'e2e',
"test/e2e/**/*": 'e2e',
"test/e2e/**/*": 'e2e',
"config/karma.coveralls.conf.js": 'coveralls',
".flowconfig": 'flow',
"decls/*": 'flow',
"test/e2e/**/*": 'e2e',
"docs/**/**": 'gitbook',
"issue_template.md": 'issue'
},
Expand Down
21 changes: 21 additions & 0 deletions template/config/karma.coveralls.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const base = require('./karma.base.conf')

module.exports = config => {
const options = Object.assign(base, {
browsers: ['PhantomJS'],
reporters: ['coverage', 'coveralls'],
coverageReporter: {
reporters: [{
type: 'lcov', dir: '../coverage'
}]
},
singleRun: true
})

// add babel-plugin-coverage for code intrumentation
options.webpack.babel = {
plugins: [['coverage', { ignore: ['test/'] }]]
}

config.set(options)
}
6 changes: 6 additions & 0 deletions template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"karma": "^0.13.9",
"karma-chrome-launcher": "^1.0.1",
"karma-coverage": "^1.0.0",
{{#coveralls}}
"karma-coveralls": "^1.1.2",
{{/coveralls}}
"karma-firefox-launcher": "^1.0.0",
"karma-jasmine": "^1.0.2",
"karma-phantomjs-launcher": "^1.0.0",
Expand Down Expand Up @@ -124,6 +127,9 @@
{{/sauce}}
"test": "npm run lint && {{#flow}}npm run flow && {{/flow}}npm run test:unit{{#e2e}} && npm run test:e2e{{/e2e}}",
"test:cover": "NODE_ENV=development karma start config/karma.cover.conf.js",
{{#coveralls}}
"test:coveralls": "NODE_ENV=development karma start config/karma.coveralls.conf.js",
{{/coveralls}}
{{#e2e}}
"test:e2e": "npm run build && node test/e2e/runner.js",
{{/e2e}}
Expand Down

0 comments on commit a7cfca0

Please sign in to comment.