Skip to content

Commit 2592e12

Browse files
IvanGoncharovmjmahone
authored andcommitted
Coverage: Switch isparta to nyc (#1342)
1 parent 6d7e08b commit 2592e12

File tree

5 files changed

+545
-165
lines changed

5 files changed

+545
-165
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ yarn.lock
1010
package-lock.json
1111

1212
.babelrc
13+
.nycrc
1314
CONTRIBUTING.md
1415
node_modules
1516
coverage

.nycrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"include": ["src/"],
3+
"exclude": [],
4+
"temp-directory": "coverage"
5+
}

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,14 @@
1414
"type": "git",
1515
"url": "http://github.com/graphql/graphql-js.git"
1616
},
17-
"options": {
18-
"mocha": "--check-leaks --full-trace --timeout 15000 src/**/__tests__/**/*-test.js"
19-
},
2017
"scripts": {
2118
"watch": "babel-node ./resources/watch.js",
2219
"test": "npm run lint && npm run check && npm run testonly",
2320
"test:ci": "npm run lint && npm run check && npm run testonly:coveralls",
24-
"t": "babel-node ./node_modules/.bin/_mocha --require ./resources/mocha-bootload",
25-
"testonly": "babel-node ./node_modules/.bin/_mocha $npm_package_options_mocha",
26-
"testonly:cover": "babel-node ./node_modules/.bin/isparta cover --root src --report html _mocha -- $npm_package_options_mocha",
27-
"testonly:coveralls": "babel-node ./node_modules/.bin/isparta cover --root src --report lcovonly _mocha -- $npm_package_options_mocha && cat ./coverage/lcov.info | coveralls",
21+
"t": "mocha --require babel-register --require babel-polyfill",
22+
"testonly": "mocha --require babel-register --require babel-polyfill --check-leaks --full-trace --timeout 15000 src/**/__tests__/**/*-test.js",
23+
"testonly:cover": "nyc --reporter html --reporter text-summary -- npm run testonly",
24+
"testonly:coveralls": "nyc --reporter text-lcov npm run testonly | coveralls",
2825
"lint": "eslint --rulesdir ./resources/lint src || (printf '\\033[33mTry: \\033[7m npm run lint -- --fix \\033[0m\\n' && exit 1)",
2926
"benchmark": "node ./resources/benchmark.js",
3027
"prettier": "prettier --write 'src/**/*.js'",
@@ -53,7 +50,9 @@
5350
"babel-plugin-transform-es2015-modules-commonjs": "6.26.0",
5451
"babel-plugin-transform-flow-strip-types": "6.22.0",
5552
"babel-plugin-transform-object-rest-spread": "6.26.0",
53+
"babel-polyfill": "^6.26.0",
5654
"babel-preset-env": "^1.5.2",
55+
"babel-register": "^6.26.0",
5756
"beautify-benchmark": "0.2.4",
5857
"benchmark": "2.1.4",
5958
"chai": "4.1.2",
@@ -63,8 +62,8 @@
6362
"eslint-plugin-flowtype": "2.46.3",
6463
"eslint-plugin-prettier": "2.6.0",
6564
"flow-bin": "0.71.0",
66-
"isparta": "4.0.0",
6765
"mocha": "5.1.1",
66+
"nyc": "^11.7.1",
6867
"prettier": "1.12.1",
6968
"sane": "2.5.0"
7069
}

resources/copy-package-json.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ const fs = require('fs');
1414

1515
const package = require('../package.json');
1616
delete package.scripts;
17-
delete package.options;
1817
delete package.devDependencies;
1918
fs.writeFileSync('./dist/package.json', JSON.stringify(package, null, 2));

0 commit comments

Comments
 (0)