diff --git a/tests/format/typescript/type-arguments-bit-shift-left-like/4.ts b/tests/format/typescript/type-arguments-bit-shift-left-like/4.ts new file mode 100644 index 000000000000..7316ad25571d --- /dev/null +++ b/tests/format/typescript/type-arguments-bit-shift-left-like/4.ts @@ -0,0 +1 @@ +(@f<(v: T) => void>() class {}); diff --git a/tests/format/typescript/type-arguments-bit-shift-left-like/__snapshots__/jsfmt.spec.js.snap b/tests/format/typescript/type-arguments-bit-shift-left-like/__snapshots__/jsfmt.spec.js.snap index b7feff584561..99030dc59eee 100644 --- a/tests/format/typescript/type-arguments-bit-shift-left-like/__snapshots__/jsfmt.spec.js.snap +++ b/tests/format/typescript/type-arguments-bit-shift-left-like/__snapshots__/jsfmt.spec.js.snap @@ -49,6 +49,30 @@ exports[`3.ts [typescript] format 1`] = ` 2 |" `; +exports[`4.ts [babel-ts] format 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +(@f<(v: T) => void>() class {}); + +=====================================output===================================== +( + @f<(v: T) => void>() + class {} +); + +================================================================================ +`; + +exports[`4.ts [typescript] format 1`] = ` +"Expression expected. (1:2) +> 1 | (@f<(v: T) => void>() class {}); + | ^ + 2 |" +`; + exports[`5.tsx [babel-ts] format 1`] = ` ====================================options===================================== parsers: ["typescript"] diff --git a/tests/format/typescript/type-arguments-bit-shift-left-like/jsfmt.spec.js b/tests/format/typescript/type-arguments-bit-shift-left-like/jsfmt.spec.js index b3acebe65b16..2775ae27811f 100644 --- a/tests/format/typescript/type-arguments-bit-shift-left-like/jsfmt.spec.js +++ b/tests/format/typescript/type-arguments-bit-shift-left-like/jsfmt.spec.js @@ -1,3 +1,3 @@ run_spec(__dirname, ["typescript"], { - errors: { typescript: ["3.ts", "5.tsx"] }, + errors: { typescript: ["3.ts", "4.ts", "5.tsx"] }, });