Skip to content

Commit 28be9be

Browse files
Move Mocha config into .mocharc.yml (graphql#1743)
1 parent c282aae commit 28be9be

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

.mocharc.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
throw-deprecation: true
2+
check-leaks: true
3+
require:
4+
- '@babel/register'
5+
- '@babel/polyfill'

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"watch": "node ./resources/watch.js",
2626
"test": "npm run lint && npm run check && npm run testonly",
2727
"test:ci": "npm run lint && npm run check && npm run testonly:cover",
28-
"t": "mocha --require @babel/register --require @babel/polyfill",
29-
"testonly": "mocha --throw-deprecation --require @babel/register --require @babel/polyfill --check-leaks --full-trace src/**/__tests__/**/*-test.js",
28+
"t": "mocha",
29+
"testonly": "mocha --full-trace src/**/__tests__/**/*-test.js",
3030
"testonly:cover": "nyc --clean --skip-full --reporter json --reporter html --reporter text -- npm run testonly",
3131
"lint": "eslint --report-unused-disable-directives src || (printf '\\033[33mTry: \\033[7m npm run lint -- --fix \\033[0m\\n' && exit 1)",
3232
"benchmark": "node ./resources/benchmark.js",

resources/watch.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,7 @@ function runTests(filepaths) {
136136

137137
return exec(
138138
'mocha',
139-
[
140-
'--reporter',
141-
'progress',
142-
'--require',
143-
'@babel/register',
144-
'--require',
145-
'@babel/polyfill',
146-
].concat(
139+
['--reporter', 'progress'].concat(
147140
allTests(filepaths)
148141
? filepaths.map(srcPath)
149142
: ['src/**/__tests__/**/*-test.js']

0 commit comments

Comments
 (0)