From 52ee73b8b29f1a6850fbb247776e1b9a896f00b8 Mon Sep 17 00:00:00 2001 From: sosukesuzuki Date: Thu, 19 Aug 2021 06:46:35 +0900 Subject: [PATCH] Add tests for babel/babel#13645 --- tests/format/flow/generic/arrows.js | 1 + .../babel-flow/__snapshots__/jsfmt.spec.js.snap | 14 ++++++++++++++ .../errors/babel-flow/wrong-arrow-no-parens-jsx.js | 1 + 3 files changed, 16 insertions(+) create mode 100644 tests/format/flow/generic/arrows.js create mode 100644 tests/format/misc/errors/babel-flow/wrong-arrow-no-parens-jsx.js diff --git a/tests/format/flow/generic/arrows.js b/tests/format/flow/generic/arrows.js new file mode 100644 index 000000000000..11885587667e --- /dev/null +++ b/tests/format/flow/generic/arrows.js @@ -0,0 +1 @@ +(a => b); diff --git a/tests/format/misc/errors/babel-flow/__snapshots__/jsfmt.spec.js.snap b/tests/format/misc/errors/babel-flow/__snapshots__/jsfmt.spec.js.snap index 770a98581a6e..f3a74f0d3dd0 100644 --- a/tests/format/misc/errors/babel-flow/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/misc/errors/babel-flow/__snapshots__/jsfmt.spec.js.snap @@ -17,3 +17,17 @@ exports[`async-arrow-invalid.js [babel-flow] format 1`] = ` | ^ 4 |" `; + +exports[`wrong-arrow-no-parens-jsx.js [babel] format 1`] = ` +"Unterminated JSX contents. (1:4) +> 1 | (a => b); + | ^ + 2 |" +`; + +exports[`wrong-arrow-no-parens-jsx.js [babel-flow] format 1`] = ` +"Unterminated JSX contents. (1:4) +> 1 | (a => b); + | ^ + 2 |" +`; diff --git a/tests/format/misc/errors/babel-flow/wrong-arrow-no-parens-jsx.js b/tests/format/misc/errors/babel-flow/wrong-arrow-no-parens-jsx.js new file mode 100644 index 000000000000..11885587667e --- /dev/null +++ b/tests/format/misc/errors/babel-flow/wrong-arrow-no-parens-jsx.js @@ -0,0 +1 @@ +(a => b);