Skip to content

Commit

Permalink
require src/index for flow tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ellbee committed Sep 7, 2016
1 parent c9c5132 commit ba48833
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions flow_test/should_fail/.flowconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[ignore]

[include]
../../src

[libs]

Expand Down
2 changes: 1 addition & 1 deletion flow_test/should_fail/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* @flow */
const reselect = require('reselect');
const reselect = require('../../src/index');
const {
createSelector,
defaultMemoize,
Expand Down
1 change: 1 addition & 0 deletions flow_test/should_pass/.flowconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[ignore]

[include]
../../src

[libs]

Expand Down
3 changes: 2 additions & 1 deletion flow_test/should_pass/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* @flow */
const reselect = require('reselect');
const reselect = require('../../src/index');

const {
createSelector,
defaultMemoize,
Expand Down
8 changes: 4 additions & 4 deletions flow_test/test.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
var run = require('child_process').execSync

try {
run('./node_modules/flow-bin/cli.js ./flow_test/should_pass')
run('$(npm bin)/flow ./flow_test/should_pass')
}
catch(e) {
// eslint-disable-next-line no-console
console.log('Typing error: valid flow typings failed to lint')
console.log('Typing error: valid flow typings in should_pass did not type check')
process.exit(1)
}

try {
run('./node_modules/flow-bin/cli.js ./flow_test/should_fail')
run('$(npm bin)/flow ./flow_test/should_fail')
}
catch(e) {
process.exit(0)
}

// eslint-disable-next-line no-console
console.log('Typing error: invalid flow typings successfully compiled')
console.log('Typing error: invalid flow typings in should_fail successfully type checked')
process.exit(1)

0 comments on commit ba48833

Please sign in to comment.