Skip to content

Commit

Permalink
feat: 安装babel-plugin-istanbul,实现覆盖率统计
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaran113 committed Nov 5, 2018
1 parent 957b912 commit 71029ee
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
7 changes: 6 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
"presets": ["es2015", "stage-0", "react"],
"plugins": [
"transform-object-assign"
]
],
"env": {
"test": {
"plugins": [ "istanbul" ]
}
}
}
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"build-animate": "cross-env NODE_ENV=production webpack src/index.jsx umd/BizCharts.min.animate.js",
"demo": "webpack-dev-server --progress --port 3510 --content-base demo --inline --config demo/webpack.config.js",
"testDemo": "webpack-dev-server --progress --port 9000 --content-base testDemo --inline --config testDemo/webpack.config.js",
"test": "cross-env NODE_ENV=test karma start test/karma.conf.js",
"test": "cross-env BABEL_ENV=test NODE_ENV=test karma start test/karma.conf.js",
"lint": "eslint src/ --ext '.js,.jsx'",
"autofix": "eslint src --fix",
"cov": "istanbul cover node_modules/mocha/bin/_mocha -- --compilers js:babel-core/register 'test/**/**/*-specs.js'",
Expand All @@ -58,9 +58,10 @@
},
"dependencies": {
"@antv/g2": "3.2.8",
"babel-plugin-istanbul": "^3.0.0",
"invariant": "^2.2.2",
"warning": "^3.0.0",
"prop-types": "^15.6.0"
"prop-types": "^15.6.0",
"warning": "^3.0.0"
},
"devDependencies": {
"@antv/data-set": "^0.9.1",
Expand Down
10 changes: 5 additions & 5 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

'use strict';

var path = require('path');
const path = require('path');

module.exports = function (config) {
if (process.env.RELEASE) {
Expand Down Expand Up @@ -91,6 +91,10 @@ module.exports = function (config) {
reporters: ['progress', 'coverage', 'coveralls'],

coverageReporter: {
files: [
'src/**/*.js',
'test/**/*.js'
],
dir: 'test',
reporters: [{
type: 'html',
Expand All @@ -103,10 +107,6 @@ module.exports = function (config) {
}],
},

webpackMiddleware: {
// webpack-dev-middleware configuration
stats: 'errors-only',
},

// web server port
port: 9876,
Expand Down

0 comments on commit 71029ee

Please sign in to comment.