Skip to content

Commit 3974438

Browse files
committed
Rename tests
1 parent 618d363 commit 3974438

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+7
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"url": "http://github.com/graphql/graphql-js.git"
1919
},
2020
"options": {
21-
"mocha": "--require ./resources/mocha-bootload src/**/__tests__/**/*.js"
21+
"mocha": "--require ./resources/mocha-bootload --check-leaks --full-trace src/**/__tests__/**/*-test.js"
2222
},
2323
"babel": {
2424
"presets": [

resources/watch.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ function runTests(filepaths) {
135135
'--reporter', 'progress',
136136
'--require', './resources/mocha-bootload',
137137
].concat(
138-
allTests(filepaths) ? filepaths.map(srcPath) : ['src/**/__tests__/**/*.js']
138+
allTests(filepaths) ?
139+
filepaths.map(srcPath) :
140+
['src/**/__tests__/**/*-test.js']
139141
)).catch(() => false);
140142
}
141143

@@ -178,8 +180,10 @@ function allTests(filepaths) {
178180
return filepaths.length > 0 && filepaths.every(isTest);
179181
}
180182

183+
var TEST_PATH_RX = /^(?:.*?\/)?__tests__\/.+?-test\.js$/;
184+
181185
function isTest(filepath) {
182-
return isJS(filepath) && ~filepath.indexOf('__tests__/');
186+
return TEST_PATH_RX.test(filepath);
183187
}
184188

185189
// Print helpers
File renamed without changes.

0 commit comments

Comments
 (0)