From f934269eaf18d51804813d8d6043036e79c21798 Mon Sep 17 00:00:00 2001 From: sosukesuzuki Date: Fri, 6 Nov 2020 11:33:45 +0900 Subject: [PATCH] Add tests for babel/babel#12221 --- .../errors/babel-ts/__snapshots__/jsfmt.spec.js.snap | 11 +++++++++++ tests/misc/errors/babel-ts/type-annotation-in-jsx.tsx | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 tests/misc/errors/babel-ts/type-annotation-in-jsx.tsx diff --git a/tests/misc/errors/babel-ts/__snapshots__/jsfmt.spec.js.snap b/tests/misc/errors/babel-ts/__snapshots__/jsfmt.spec.js.snap index 63d4dde0ac58..e5c3104547cb 100644 --- a/tests/misc/errors/babel-ts/__snapshots__/jsfmt.spec.js.snap +++ b/tests/misc/errors/babel-ts/__snapshots__/jsfmt.spec.js.snap @@ -13,3 +13,14 @@ exports[`type-annotation-func.ts error test 1`] = ` | ^ 2 | " `; + +exports[`type-annotation-in-jsx.tsx error test 1`] = ` +"Did not expect a type annotation here. (3:22) + 1 | function Foo() { + 2 | return ( +> 3 |
+ | ^ + 4 | ); + 5 | } + 6 | " +`; diff --git a/tests/misc/errors/babel-ts/type-annotation-in-jsx.tsx b/tests/misc/errors/babel-ts/type-annotation-in-jsx.tsx new file mode 100644 index 000000000000..ae4343ec3e21 --- /dev/null +++ b/tests/misc/errors/babel-ts/type-annotation-in-jsx.tsx @@ -0,0 +1,5 @@ +function Foo() { + return ( +
+ ); +}