diff --git a/package.json b/package.json index 86ca075..b9e6295 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "example": "example" }, "scripts": { - "test-travis": "./node_modules/karma/bin/karma start ./test/karma.conf.js --single-run", + "test-travis": "./node_modules/karma/bin/karma start ./test/karma.conf.js --single-run --browsers chromeTravisCI", "test": "./node_modules/karma/bin/karma start ./test/karma.conf.js --no-single-run", "build": "gulp" }, @@ -33,6 +33,7 @@ "eslint-config-pebble": "^1.2.0", "eslint-plugin-standard": "^1.3.1", "gulp-autoprefixer": "^3.1.0", + "gulp-htmlmin": "^1.3.0", "gulp-sass": "^2.1.1", "gulp-sourcemaps": "^1.6.0", "karma": "^0.13.19", @@ -42,6 +43,7 @@ "karma-mocha": "^0.2.1", "karma-mocha-reporter": "^1.1.5", "karma-source-map-support": "^1.1.0", + "karma-threshold-reporter": "^0.1.15", "mocha": "^2.3.4", "watchify": "^3.7.0" }, diff --git a/test/karma.conf.js b/test/karma.conf.js index e4732ff..89a1024 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -45,7 +45,7 @@ module.exports = function(config) { // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress', 'mocha', 'coverage'], + reporters: ['progress', 'mocha', 'coverage', 'threshold'], // optionally, configure the reporter coverageReporter: { @@ -56,6 +56,13 @@ module.exports = function(config) { ] }, + thresholdReporter: { + statements: 100, + branches: 100, + functions: 100, + lines: 100 + }, + // web server port port: 9876, @@ -74,6 +81,14 @@ module.exports = function(config) { // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher browsers: ['Chrome'], + // set via the command line + customLaunchers: { + chromeTravisCI: { + base: 'Chrome', + flags: ['--no-sandbox'] + } + }, + // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits singleRun: true,