|
3 | 3 | exports[`transform in strip-only mode should not emit 'Caused by: failed to parse' 1`] = `
|
4 | 4 | {
|
5 | 5 | "code": "InvalidSyntax",
|
6 |
| - "message": " |
7 |
| - x await isn't allowed in non-async function |
| 6 | + "message": " x await isn't allowed in non-async function |
8 | 7 | ,----
|
9 | 8 | 1 | function foo() { await Promise.resolve(1); }
|
10 | 9 | : ^^^^^^^
|
@@ -39,6 +38,32 @@ exports[`transform in strip-only mode should remove declare enum 3`] = `
|
39 | 38 | }
|
40 | 39 | `;
|
41 | 40 |
|
| 41 | +exports[`transform in strip-only mode should report correct error for syntax error 1`] = ` |
| 42 | +{ |
| 43 | + "code": "InvalidSyntax", |
| 44 | + "message": " x Expected ';', '}' or <eof> |
| 45 | + ,---- |
| 46 | + 1 | function foo() { invalid syntax } |
| 47 | + : ^^^|^^^ ^^^^^^ |
| 48 | + : \`-- This is the expression part of an expression statement |
| 49 | + \`---- |
| 50 | +", |
| 51 | +} |
| 52 | +`; |
| 53 | +
|
| 54 | +exports[`transform in strip-only mode should report correct error for unsupported syntax 1`] = ` |
| 55 | +{ |
| 56 | + "code": "UnsupportedSyntax", |
| 57 | + "message": " x TypeScript enum is not supported in strip-only mode |
| 58 | + ,-[1:1] |
| 59 | + 1 | ,-> enum Foo { |
| 60 | + 2 | | a, b |
| 61 | + 3 | \`-> } |
| 62 | + \`---- |
| 63 | +", |
| 64 | +} |
| 65 | +`; |
| 66 | +
|
42 | 67 | exports[`transform in strip-only mode should strip complex expressions 1`] = `
|
43 | 68 | {
|
44 | 69 | "code": "const foo = {
|
@@ -93,33 +118,39 @@ exports[`transform in strip-only mode should strip type declarations 1`] = `
|
93 | 118 | `;
|
94 | 119 |
|
95 | 120 | exports[`transform in strip-only mode should throw an error when it encounters a module 1`] = `
|
96 |
| -" |
97 |
| - x TypeScript namespace declaration is not supported in strip-only mode |
| 121 | +{ |
| 122 | + "code": "UnsupportedSyntax", |
| 123 | + "message": " x TypeScript namespace declaration is not supported in strip-only mode |
98 | 124 | ,----
|
99 | 125 | 1 | module foo {}
|
100 | 126 | : ^^^^^^^^^^^^^
|
101 | 127 | \`----
|
102 |
| -" |
| 128 | +", |
| 129 | +} |
103 | 130 | `;
|
104 | 131 |
|
105 | 132 | exports[`transform in strip-only mode should throw an error when it encounters a namespace 1`] = `
|
106 |
| -" |
107 |
| - x TypeScript namespace declaration is not supported in strip-only mode |
| 133 | +{ |
| 134 | + "code": "UnsupportedSyntax", |
| 135 | + "message": " x TypeScript namespace declaration is not supported in strip-only mode |
108 | 136 | ,----
|
109 | 137 | 1 | namespace Foo {}
|
110 | 138 | : ^^^^^^^^^^^^^^^^
|
111 | 139 | \`----
|
112 |
| -" |
| 140 | +", |
| 141 | +} |
113 | 142 | `;
|
114 | 143 |
|
115 | 144 | exports[`transform in strip-only mode should throw an error when it encounters an enum 1`] = `
|
116 |
| -" |
117 |
| - x TypeScript enum is not supported in strip-only mode |
| 145 | +{ |
| 146 | + "code": "UnsupportedSyntax", |
| 147 | + "message": " x TypeScript enum is not supported in strip-only mode |
118 | 148 | ,----
|
119 | 149 | 1 | enum Foo {}
|
120 | 150 | : ^^^^^^^^^^^
|
121 | 151 | \`----
|
122 |
| -" |
| 152 | +", |
| 153 | +} |
123 | 154 | `;
|
124 | 155 |
|
125 | 156 | exports[`transform should strip types 1`] = `
|
|
0 commit comments