Skip to content

Commit edb93bd

Browse files
authored
Merge pull request #462 from reactjs/constantinople
Switch to babel-plugin-istanbul and nyc
2 parents dccf87c + 4dae144 commit edb93bd

File tree

5 files changed

+23
-7
lines changed

5 files changed

+23
-7
lines changed

.babelrc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
plugins: [
2+
"plugins": [
33
"transform-decorators-legacy",
44
["transform-es2015-template-literals", { "loose": true }],
55
"transform-es2015-literals",
@@ -22,5 +22,10 @@
2222
"transform-object-rest-spread",
2323
"transform-react-jsx",
2424
"syntax-jsx"
25-
]
25+
],
26+
"env": {
27+
"test": {
28+
"plugins": ["istanbul"]
29+
}
30+
}
2631
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ npm-debug.log
33
.DS_Store
44
dist
55
lib
6+
.nyc_output
67
coverage

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ node_js:
33
- "5"
44
script:
55
- npm run lint
6-
- npm test
6+
- npm run test:cov
7+
after_success:
8+
- npm run coverage

codecov.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
comment: false

package.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
"clean": "rimraf lib dist coverage",
1212
"lint": "eslint src test",
1313
"prepublish": "npm run clean && npm run build",
14-
"test": "mocha --compilers js:babel-register --recursive --require ./test/setup.js",
14+
"test": "cross-env NODE_ENV=test mocha --compilers js:babel-register --recursive --require ./test/setup.js",
1515
"test:watch": "npm test -- --watch",
16-
"test:cov": "babel-node ./node_modules/isparta/bin/isparta cover ./node_modules/mocha/bin/_mocha -- --recursive"
16+
"test:cov": "cross-env NODE_ENV=test nyc npm test",
17+
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov"
1718
},
1819
"repository": {
1920
"type": "git",
@@ -47,6 +48,7 @@
4748
"babel-eslint": "^6.1.2",
4849
"babel-loader": "^6.2.0",
4950
"babel-plugin-check-es2015-constants": "^6.3.13",
51+
"babel-plugin-istanbul": "^2.0.0",
5052
"babel-plugin-syntax-jsx": "^6.3.13",
5153
"babel-plugin-transform-decorators-legacy": "^1.2.0",
5254
"babel-plugin-transform-es2015-arrow-functions": "^6.3.13",
@@ -70,17 +72,18 @@
7072
"babel-plugin-transform-react-display-name": "^6.4.0",
7173
"babel-plugin-transform-react-jsx": "^6.4.0",
7274
"babel-register": "^6.3.13",
75+
"codecov": "^1.0.1",
7376
"cross-env": "^1.0.7",
7477
"es3ify": "^0.2.0",
7578
"eslint": "^3.3.1",
7679
"eslint-plugin-import": "^1.13.0",
7780
"eslint-plugin-react": "^6.1.1",
7881
"expect": "^1.8.0",
7982
"glob": "^6.0.4",
80-
"isparta": "4.0.0",
81-
"istanbul": "^0.3.17",
83+
"istanbul": "^0.4.4",
8284
"jsdom": "~5.4.3",
8385
"mocha": "^2.2.5",
86+
"nyc": "^8.1.0",
8487
"react": "^0.14.0",
8588
"react-addons-test-utils": "^0.14.0",
8689
"react-dom": "^0.14.0",
@@ -102,5 +105,9 @@
102105
"transform": [
103106
"loose-envify"
104107
]
108+
},
109+
"nyc": {
110+
"sourceMap": false,
111+
"instrument": false
105112
}
106113
}

0 commit comments

Comments
 (0)