Skip to content

Commit

Permalink
Speed up flow check (#1241)
Browse files Browse the repository at this point in the history
`flow check` is easily taking 30 seconds on my development machine,
presumably it's checking too many files. Move the .flowconfig into
the flow-types test directory and only include the index.js.flow file
to improve check speed.
  • Loading branch information
novemberborn authored and sindresorhus committed Feb 18, 2017
1 parent d47c5c8 commit 7cba283
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -43,7 +43,7 @@
"node": ">=4"
},
"scripts": {
"test": "xo && flow check && nyc tap --no-cov --timeout=150 --jobs=4 test/*.js test/reporters/*.js",
"test": "xo && flow check test/flow-types && nyc tap --no-cov --timeout=150 --jobs=4 test/*.js test/reporters/*.js",
"test-win": "tap --no-cov --reporter=classic --timeout=150 --jobs=4 test/*.js test/reporters/*.js",
"visual": "node test/visual/run-visual-tests.js",
"prepublish": "npm run make-ts",
Expand Down
5 changes: 2 additions & 3 deletions .flowconfig → test/flow-types/.flowconfig
@@ -1,6 +1,5 @@
[ignore]
<PROJECT_ROOT>/node_modules/.*
<PROJECT_ROOT>/.*\.js$
[include]
../../*.js.flow$

[options]
emoji=true
Expand Down
2 changes: 1 addition & 1 deletion test/flow-types/regression-1114.js.flow
@@ -1,6 +1,6 @@
/* @flow */

const test = require('../../');
const test = require('../../index.js.flow');

test('Named test', t => {
t.pass('Success');
Expand Down
2 changes: 1 addition & 1 deletion test/flow-types/regression-1148.js.flow
@@ -1,6 +1,6 @@
/* @flow */

const test = require('../../');
const test = require('../../index.js.flow');

test(t => {
t.throws(() => { throw new Error(); });
Expand Down

0 comments on commit 7cba283

Please sign in to comment.