Skip to content

Commit

Permalink
Add tests on invalid flow async generic arrow syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Sep 1, 2020
1 parent 08d53bf commit b6f16b3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/misc/errors/flow/__snapshots__/jsfmt.spec.js.snap
@@ -1,5 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`async-arrow-invalid.js error test 1`] = `
"Unexpected token ILLEGAL (2:1)
1 | <T> async () => {}
> 2 |
| ^"
`;
exports[`default-escaped.js error test 1`] = `
"Unexpected identifier, expected the token \`{\` (1:8)
> 1 | export asyn\\\\u{63} from \\"async\\";
Expand Down
1 change: 1 addition & 0 deletions tests/misc/errors/flow/async-arrow-invalid.js
@@ -0,0 +1 @@
<T> async () => {}
14 changes: 14 additions & 0 deletions tests/misc/flow-babel-only/__snapshots__/jsfmt.spec.js.snap
@@ -1,5 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`async-arrow-invalid.js format 1`] = `
====================================options=====================================
parsers: ["babel"]
printWidth: 80
| printWidth
=====================================input======================================
<T> async () => {}
=====================================output=====================================
async <T>() => {};
================================================================================
`;
exports[`class_with_generics.js format 1`] = `
====================================options=====================================
parsers: ["babel"]
Expand Down
1 change: 1 addition & 0 deletions tests/misc/flow-babel-only/async-arrow-invalid.js
@@ -0,0 +1 @@
<T> async () => {}

0 comments on commit b6f16b3

Please sign in to comment.