Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for Reinterpret << when parsing TS type arguments babel/babe…
- Loading branch information
Showing
8 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
tests/format/typescript/type-arguments-bit-shift-left-like/1.ts
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 @@ | ||
f<<<T>(x) |
1 change: 1 addition & 0 deletions
1
tests/format/typescript/type-arguments-bit-shift-left-like/2.ts
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 @@ | ||
f<<T>(v: T) => void>(); |
1 change: 1 addition & 0 deletions
1
tests/format/typescript/type-arguments-bit-shift-left-like/3.ts
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 @@ | ||
(class extends f<<T>(v: T) => void> {}); |
1 change: 1 addition & 0 deletions
1
tests/format/typescript/type-arguments-bit-shift-left-like/4.ts
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 @@ | ||
(@f<<T>(v: T) => void>() class {}); |
1 change: 1 addition & 0 deletions
1
tests/format/typescript/type-arguments-bit-shift-left-like/5.tsx
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 @@ | ||
<Component<<T>(v: T) => void> /> |
1 change: 1 addition & 0 deletions
1
tests/format/typescript/type-arguments-bit-shift-left-like/6.ts
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 @@ | ||
new f<<T>(v: T) => void>(); |
107 changes: 107 additions & 0 deletions
107
tests/format/typescript/type-arguments-bit-shift-left-like/__snapshots__/jsfmt.spec.js.snap
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,107 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`1.ts format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["typescript"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
f<<<T>(x) | ||
=====================================output===================================== | ||
f << (<T>x); | ||
================================================================================ | ||
`; | ||
exports[`2.ts format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["typescript"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
f<<T>(v: T) => void>(); | ||
=====================================output===================================== | ||
f<<T>(v: T) => void>(); | ||
================================================================================ | ||
`; | ||
exports[`3.ts [babel-ts] format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["typescript"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
(class extends f<<T>(v: T) => void> {}); | ||
=====================================output===================================== | ||
(class extends f<<T>(v: T) => void> {}); | ||
================================================================================ | ||
`; | ||
exports[`3.ts [typescript] format 1`] = ` | ||
"',' expected. (1:17) | ||
> 1 | (class extends f<<T>(v: T) => void> {}); | ||
| ^ | ||
2 |" | ||
`; | ||
exports[`4.ts [babel-ts] format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["typescript"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
(@f<<T>(v: T) => void>() class {}); | ||
=====================================output===================================== | ||
@f<<T>(v: T) => void>() | ||
class {}; | ||
================================================================================ | ||
`; | ||
exports[`4.ts [typescript] format 1`] = ` | ||
"Expression expected. (1:2) | ||
> 1 | (@f<<T>(v: T) => void>() class {}); | ||
| ^ | ||
2 |" | ||
`; | ||
exports[`5.tsx [babel-ts] format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["typescript"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
<Component<<T>(v: T) => void> /> | ||
=====================================output===================================== | ||
<Component<<T>(v: T) => void> />; | ||
================================================================================ | ||
`; | ||
exports[`5.tsx [typescript] format 1`] = ` | ||
"Identifier expected. (1:11) | ||
> 1 | <Component<<T>(v: T) => void> /> | ||
| ^ | ||
2 |" | ||
`; | ||
exports[`6.ts format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["typescript"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
new f<<T>(v: T) => void>(); | ||
=====================================output===================================== | ||
new f<<T>(v: T) => void>(); | ||
================================================================================ | ||
`; |
3 changes: 3 additions & 0 deletions
3
tests/format/typescript/type-arguments-bit-shift-left-like/jsfmt.spec.js
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,3 @@ | ||
run_spec(__dirname, ["typescript"], { | ||
errors: { typescript: ["3.ts", "4.ts", "5.tsx"] }, | ||
}); |