1
0
mirror of synced 2025-12-10 08:28:08 +08:00

Add: Coverage report

This commit is contained in:
surunzi
2017-10-14 14:04:33 +08:00
parent b0ae09d77d
commit 66b5e950df
4 changed files with 19 additions and 6 deletions

1
.gitignore vendored
View File

@@ -1,6 +1,7 @@
/.idea/
/node_modules/
/test/lib/
/coverage/
/test/playground.html
eruda*
/script/icomoon/

View File

@@ -1,6 +1,7 @@
/eustia/
/.idea/
/src/
/coverage/
/test/
/doc/
/script/

View File

@@ -1,10 +1,12 @@
var webpackCfg = require('./script/webpack.release');
module.exports = function (config)
{
config.set({
basePath: '',
frameworks: ['jquery-1.8.3'],
files: [
'eruda.js',
'src/index.js',
'test/init.js',
'node_modules/jasmine-core/lib/jasmine-core/jasmine.js',
'node_modules/karma-jasmine/lib/boot.js',
@@ -24,15 +26,19 @@ module.exports = function (config)
'karma-jasmine',
'karma-jquery',
'karma-phantomjs-launcher',
'karma-wrap-preprocessor'
'karma-wrap-preprocessor',
'karma-coverage',
'karma-webpack'
],
preprocessors: {
'test/*.js': ['wrap']
'test/*.js': ['wrap'],
'src/index.js': ['webpack', 'coverage']
},
webpack: webpackCfg,
wrapPreprocessor: {
template: '(function () { <%= contents %> })()'
},
reporters: ['progress'],
reporters: ['progress', 'coverage'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,

View File

@@ -4,7 +4,7 @@
"description": "Console for Mobile Browsers",
"main": "eruda.js",
"scripts": {
"ci": "npm run lint && npm run build && npm run test",
"ci": "npm run lint && npm run test && npm run build",
"build": "webpack --config script/webpack.dev.js && webpack -p --config script/webpack.release.js",
"dev": "webpack-dev-server --config script/webpack.dev.js --host 0.0.0.0",
"test": "karma start",
@@ -24,7 +24,10 @@
"format": "commonjs"
},
"test": {
"files": ["test/**/*.js", "test/**/*.html"],
"files": [
"test/**/*.js",
"test/**/*.html"
],
"output": "test/util.js",
"format": "global"
}
@@ -62,9 +65,11 @@
"js-beautify": "^1.6.2",
"json-loader": "^0.5.4",
"karma": "^1.7.0",
"karma-coverage": "^1.1.1",
"karma-jasmine": "^1.1.0",
"karma-jquery": "^0.2.2",
"karma-phantomjs-launcher": "^1.0.4",
"karma-webpack": "^2.0.5",
"karma-wrap-preprocessor": "^0.1.0",
"modernizr": "^3.3.1",
"node-sass": "^4.5.0",