-
-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* IMPORTANT | ||
* This snapshot file is auto-generated, but designed for humans. | ||
* It should be checked into source control and tracked carefully. | ||
* Re-generate by setting TAP_SNAPSHOT=1 and running tests. | ||
* Make sure to inspect the output below. Do not ignore changes! | ||
*/ | ||
'use strict' | ||
exports[`test/run/flow.js TAP flow > must match snapshot 1`] = ` | ||
TAP version 13 | ||
ok 1 - cli-tests/flow/ok.js # {time} { | ||
ok 1 - this is fine | ||
1..1 | ||
# {time} | ||
} | ||
1..1 | ||
# {time} | ||
` | ||
|
||
exports[`test/run/flow.js TAP flow manually > must match snapshot 1`] = ` | ||
TAP version 13 | ||
ok 1 - cli-tests/flow/ok2.js # {time} { | ||
ok 1 - this is fine | ||
1..1 | ||
# {time} | ||
} | ||
1..1 | ||
# {time} | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const { | ||
tmpfile, | ||
run, | ||
tap, | ||
t, | ||
} = require('./') | ||
|
||
|
||
t.test('flow', t => { | ||
const ok = tmpfile(t, 'flow/ok.js', ` | ||
// @flow | ||
const t = require(${tap}) | ||
function square(n: number): number { | ||
return n * n; | ||
} | ||
t.pass('this is fine') | ||
`) | ||
|
||
const args = [ok, '--flow'] | ||
|
||
run(args, {}, (er, o, e) => { | ||
t.equal(er, null) | ||
t.matchSnapshot(o) | ||
t.end() | ||
}) | ||
}) | ||
|
||
t.test('flow manually', t => { | ||
const ok = tmpfile(t, 'flow/ok2.js', ` | ||
// @flow | ||
const t = require(${tap}) | ||
function square(n: number): number { | ||
return n * n; | ||
} | ||
t.pass('this is fine') | ||
`) | ||
|
||
const args = [ok, '--node-arg=--require', '--node-arg=flow-remove-types/register'] | ||
|
||
run(args, {}, (er, o, e) => { | ||
t.equal(er, null) | ||
t.matchSnapshot(o) | ||
t.end() | ||
}) | ||
}) |