From 627c760e9707aaadf0a5a8717be52fc30b08ebbd Mon Sep 17 00:00:00 2001 From: Mark Wubben Date: Wed, 8 Feb 2017 12:34:08 +0000 Subject: [PATCH] Speed up flow check `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. --- package.json | 2 +- .flowconfig => test/flow-types/.flowconfig | 5 ++--- test/flow-types/regression-1114.js.flow | 2 +- test/flow-types/regression-1148.js.flow | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) rename .flowconfig => test/flow-types/.flowconfig (51%) diff --git a/package.json b/package.json index 4ec1a36f5..122ca99bf 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/.flowconfig b/test/flow-types/.flowconfig similarity index 51% rename from .flowconfig rename to test/flow-types/.flowconfig index d0c7084f7..23066fc9c 100644 --- a/.flowconfig +++ b/test/flow-types/.flowconfig @@ -1,6 +1,5 @@ -[ignore] -/node_modules/.* -/.*\.js$ +[include] +../../*.js.flow$ [options] emoji=true diff --git a/test/flow-types/regression-1114.js.flow b/test/flow-types/regression-1114.js.flow index 60101316d..616668dbf 100644 --- a/test/flow-types/regression-1114.js.flow +++ b/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'); diff --git a/test/flow-types/regression-1148.js.flow b/test/flow-types/regression-1148.js.flow index feb279f8e..f08f65dcf 100644 --- a/test/flow-types/regression-1148.js.flow +++ b/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(); });