|
3 | 3 | exports[`transform in strip-only mode should not emit 'Caused by: failed to parse' 1`] = `
|
4 | 4 | {
|
5 | 5 | "code": "InvalidSyntax",
|
6 |
| - "column": 23, |
| 6 | + "endColumn": 30, |
| 7 | + "endLine": 1, |
7 | 8 | "filename": "test.ts",
|
8 |
| - "line": 1, |
9 | 9 | "message": "await isn't allowed in non-async function",
|
10 | 10 | "snippet": "Promise",
|
| 11 | + "startColumn": 23, |
| 12 | + "startLine": 1, |
11 | 13 | }
|
12 | 14 | `;
|
13 | 15 |
|
@@ -40,24 +42,28 @@ exports[`transform in strip-only mode should remove declare enum 3`] = `
|
40 | 42 | exports[`transform in strip-only mode should report correct error for syntax error 1`] = `
|
41 | 43 | {
|
42 | 44 | "code": "InvalidSyntax",
|
43 |
| - "column": 25, |
| 45 | + "endColumn": 31, |
| 46 | + "endLine": 1, |
44 | 47 | "filename": "test.ts",
|
45 |
| - "line": 1, |
46 | 48 | "message": "Expected ';', '}' or <eof>",
|
47 | 49 | "snippet": "syntax",
|
| 50 | + "startColumn": 25, |
| 51 | + "startLine": 1, |
48 | 52 | }
|
49 | 53 | `;
|
50 | 54 |
|
51 | 55 | exports[`transform in strip-only mode should report correct error for unsupported syntax 1`] = `
|
52 | 56 | {
|
53 | 57 | "code": "UnsupportedSyntax",
|
54 |
| - "column": 0, |
| 58 | + "endColumn": 21, |
| 59 | + "endLine": 3, |
55 | 60 | "filename": "test.ts",
|
56 |
| - "line": 1, |
57 | 61 | "message": "TypeScript enum is not supported in strip-only mode",
|
58 | 62 | "snippet": "enum Foo {
|
59 | 63 | a, b
|
60 | 64 | }",
|
| 65 | + "startColumn": 0, |
| 66 | + "startLine": 1, |
61 | 67 | }
|
62 | 68 | `;
|
63 | 69 |
|
@@ -117,77 +123,91 @@ exports[`transform in strip-only mode should strip type declarations 1`] = `
|
117 | 123 | exports[`transform in strip-only mode should throw an error when it encounters a module 1`] = `
|
118 | 124 | {
|
119 | 125 | "code": "UnsupportedSyntax",
|
120 |
| - "column": 0, |
| 126 | + "endColumn": 10, |
| 127 | + "endLine": 1, |
121 | 128 | "filename": "test.ts",
|
122 |
| - "line": 1, |
123 | 129 | "message": "\`module\` keyword is not supported. Use \`namespace\` instead.",
|
124 | 130 | "snippet": "module foo",
|
| 131 | + "startColumn": 0, |
| 132 | + "startLine": 1, |
125 | 133 | }
|
126 | 134 | `;
|
127 | 135 |
|
128 | 136 | exports[`transform in strip-only mode should throw an error when it encounters a module 2`] = `
|
129 | 137 | {
|
130 | 138 | "code": "UnsupportedSyntax",
|
131 |
| - "column": 8, |
| 139 | + "endColumn": 18, |
| 140 | + "endLine": 1, |
132 | 141 | "filename": "test.ts",
|
133 |
| - "line": 1, |
134 | 142 | "message": "\`module\` keyword is not supported. Use \`namespace\` instead.",
|
135 | 143 | "snippet": "module foo",
|
| 144 | + "startColumn": 8, |
| 145 | + "startLine": 1, |
136 | 146 | }
|
137 | 147 | `;
|
138 | 148 |
|
139 | 149 | exports[`transform in strip-only mode should throw an error when it encounters a namespace 1`] = `
|
140 | 150 | {
|
141 | 151 | "code": "UnsupportedSyntax",
|
142 |
| - "column": 0, |
| 152 | + "endColumn": 37, |
| 153 | + "endLine": 1, |
143 | 154 | "filename": "test.ts",
|
144 |
| - "line": 1, |
145 | 155 | "message": "TypeScript namespace declaration is not supported in strip-only mode",
|
146 | 156 | "snippet": "namespace Foo { export const m = 1; }",
|
| 157 | + "startColumn": 0, |
| 158 | + "startLine": 1, |
147 | 159 | }
|
148 | 160 | `;
|
149 | 161 |
|
150 | 162 | exports[`transform in strip-only mode should throw an error when it encounters an enum 1`] = `
|
151 | 163 | {
|
152 | 164 | "code": "UnsupportedSyntax",
|
153 |
| - "column": 0, |
| 165 | + "endColumn": 11, |
| 166 | + "endLine": 1, |
154 | 167 | "filename": "test.ts",
|
155 |
| - "line": 1, |
156 | 168 | "message": "TypeScript enum is not supported in strip-only mode",
|
157 | 169 | "snippet": "enum Foo {}",
|
| 170 | + "startColumn": 0, |
| 171 | + "startLine": 1, |
158 | 172 | }
|
159 | 173 | `;
|
160 | 174 |
|
161 | 175 | exports[`transform in transform mode shoud throw an object even with deprecatedTsModuleAsError = true 1`] = `
|
162 | 176 | {
|
163 | 177 | "code": "UnsupportedSyntax",
|
164 |
| - "column": 0, |
| 178 | + "endColumn": 8, |
| 179 | + "endLine": 1, |
165 | 180 | "filename": "<anon>",
|
166 |
| - "line": 1, |
167 | 181 | "message": "\`module\` keyword is not supported. Use \`namespace\` instead.",
|
168 | 182 | "snippet": "module F",
|
| 183 | + "startColumn": 0, |
| 184 | + "startLine": 1, |
169 | 185 | }
|
170 | 186 | `;
|
171 | 187 |
|
172 | 188 | exports[`transform in transform mode should throw an error when it encounters a declared module 1`] = `
|
173 | 189 | {
|
174 | 190 | "code": "UnsupportedSyntax",
|
175 |
| - "column": 8, |
| 191 | + "endColumn": 18, |
| 192 | + "endLine": 1, |
176 | 193 | "filename": "test.ts",
|
177 |
| - "line": 1, |
178 | 194 | "message": "\`module\` keyword is not supported. Use \`namespace\` instead.",
|
179 | 195 | "snippet": "module foo",
|
| 196 | + "startColumn": 8, |
| 197 | + "startLine": 1, |
180 | 198 | }
|
181 | 199 | `;
|
182 | 200 |
|
183 | 201 | exports[`transform in transform mode should throw an error when it encounters a module 1`] = `
|
184 | 202 | {
|
185 | 203 | "code": "UnsupportedSyntax",
|
186 |
| - "column": 0, |
| 204 | + "endColumn": 10, |
| 205 | + "endLine": 1, |
187 | 206 | "filename": "test.ts",
|
188 |
| - "line": 1, |
189 | 207 | "message": "\`module\` keyword is not supported. Use \`namespace\` instead.",
|
190 | 208 | "snippet": "module foo",
|
| 209 | + "startColumn": 0, |
| 210 | + "startLine": 1, |
191 | 211 | }
|
192 | 212 | `;
|
193 | 213 |
|
|
0 commit comments