|
1 | 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
|
2 | 2 |
|
3 | 3 | exports[`transform in strip-only mode should not emit 'Caused by: failed to parse' 1`] = `
|
4 |
| -"{"code":"InvalidSyntax","message":"await isn't allowed in non-async function","snippet":"Promise","filename":"test.ts","line":1,"column":23} |
5 |
| -" |
| 4 | +Map { |
| 5 | + "code" => "InvalidSyntax", |
| 6 | + "column" => 23, |
| 7 | + "filename" => "test.ts", |
| 8 | + "line" => 1, |
| 9 | + "message" => "await isn't allowed in non-async function", |
| 10 | + "snippet" => "Promise", |
| 11 | +} |
6 | 12 | `;
|
7 | 13 |
|
8 | 14 | exports[`transform in strip-only mode should remove declare enum 1`] = `
|
@@ -32,13 +38,27 @@ exports[`transform in strip-only mode should remove declare enum 3`] = `
|
32 | 38 | `;
|
33 | 39 |
|
34 | 40 | exports[`transform in strip-only mode should report correct error for syntax error 1`] = `
|
35 |
| -"{"code":"InvalidSyntax","message":"Expected ';', '}' or <eof>","snippet":"syntax","filename":"test.ts","line":1,"column":25} |
36 |
| -" |
| 41 | +Map { |
| 42 | + "code" => "InvalidSyntax", |
| 43 | + "column" => 25, |
| 44 | + "filename" => "test.ts", |
| 45 | + "line" => 1, |
| 46 | + "message" => "Expected ';', '}' or <eof>", |
| 47 | + "snippet" => "syntax", |
| 48 | +} |
37 | 49 | `;
|
38 | 50 |
|
39 | 51 | exports[`transform in strip-only mode should report correct error for unsupported syntax 1`] = `
|
40 |
| -"{"code":"UnsupportedSyntax","message":"TypeScript enum is not supported in strip-only mode","snippet":"enum Foo {\\n a, b \\n }","filename":"test.ts","line":1,"column":0} |
41 |
| -" |
| 52 | +Map { |
| 53 | + "code" => "UnsupportedSyntax", |
| 54 | + "column" => 0, |
| 55 | + "filename" => "test.ts", |
| 56 | + "line" => 1, |
| 57 | + "message" => "TypeScript enum is not supported in strip-only mode", |
| 58 | + "snippet" => "enum Foo { |
| 59 | + a, b |
| 60 | + }", |
| 61 | +} |
42 | 62 | `;
|
43 | 63 |
|
44 | 64 | exports[`transform in strip-only mode should strip complex expressions 1`] = `
|
@@ -95,38 +115,80 @@ exports[`transform in strip-only mode should strip type declarations 1`] = `
|
95 | 115 | `;
|
96 | 116 |
|
97 | 117 | exports[`transform in strip-only mode should throw an error when it encounters a module 1`] = `
|
98 |
| -"{"code":"UnsupportedSyntax","message":"\`module\` keyword is not supported. Use \`namespace\` instead.","snippet":"module foo","filename":"test.ts","line":1,"column":0} |
99 |
| -" |
| 118 | +Map { |
| 119 | + "code" => "UnsupportedSyntax", |
| 120 | + "column" => 0, |
| 121 | + "filename" => "test.ts", |
| 122 | + "line" => 1, |
| 123 | + "message" => "\`module\` keyword is not supported. Use \`namespace\` instead.", |
| 124 | + "snippet" => "module foo", |
| 125 | +} |
100 | 126 | `;
|
101 | 127 |
|
102 | 128 | exports[`transform in strip-only mode should throw an error when it encounters a module 2`] = `
|
103 |
| -"{"code":"UnsupportedSyntax","message":"\`module\` keyword is not supported. Use \`namespace\` instead.","snippet":"module foo","filename":"test.ts","line":1,"column":8} |
104 |
| -" |
| 129 | +Map { |
| 130 | + "code" => "UnsupportedSyntax", |
| 131 | + "column" => 8, |
| 132 | + "filename" => "test.ts", |
| 133 | + "line" => 1, |
| 134 | + "message" => "\`module\` keyword is not supported. Use \`namespace\` instead.", |
| 135 | + "snippet" => "module foo", |
| 136 | +} |
105 | 137 | `;
|
106 | 138 |
|
107 | 139 | exports[`transform in strip-only mode should throw an error when it encounters a namespace 1`] = `
|
108 |
| -"{"code":"UnsupportedSyntax","message":"TypeScript namespace declaration is not supported in strip-only mode","snippet":"namespace Foo { export const m = 1; }","filename":"test.ts","line":1,"column":0} |
109 |
| -" |
| 140 | +Map { |
| 141 | + "code" => "UnsupportedSyntax", |
| 142 | + "column" => 0, |
| 143 | + "filename" => "test.ts", |
| 144 | + "line" => 1, |
| 145 | + "message" => "TypeScript namespace declaration is not supported in strip-only mode", |
| 146 | + "snippet" => "namespace Foo { export const m = 1; }", |
| 147 | +} |
110 | 148 | `;
|
111 | 149 |
|
112 | 150 | exports[`transform in strip-only mode should throw an error when it encounters an enum 1`] = `
|
113 |
| -"{"code":"UnsupportedSyntax","message":"TypeScript enum is not supported in strip-only mode","snippet":"enum Foo {}","filename":"test.ts","line":1,"column":0} |
114 |
| -" |
| 151 | +Map { |
| 152 | + "code" => "UnsupportedSyntax", |
| 153 | + "column" => 0, |
| 154 | + "filename" => "test.ts", |
| 155 | + "line" => 1, |
| 156 | + "message" => "TypeScript enum is not supported in strip-only mode", |
| 157 | + "snippet" => "enum Foo {}", |
| 158 | +} |
115 | 159 | `;
|
116 | 160 |
|
117 | 161 | exports[`transform in transform mode shoud throw an object even with deprecatedTsModuleAsError = true 1`] = `
|
118 |
| -"{"code":"UnsupportedSyntax","message":"\`module\` keyword is not supported. Use \`namespace\` instead.","snippet":"module F","filename":"<anon>","line":1,"column":0} |
119 |
| -" |
| 162 | +Map { |
| 163 | + "code" => "UnsupportedSyntax", |
| 164 | + "column" => 0, |
| 165 | + "filename" => "<anon>", |
| 166 | + "line" => 1, |
| 167 | + "message" => "\`module\` keyword is not supported. Use \`namespace\` instead.", |
| 168 | + "snippet" => "module F", |
| 169 | +} |
120 | 170 | `;
|
121 | 171 |
|
122 | 172 | exports[`transform in transform mode should throw an error when it encounters a declared module 1`] = `
|
123 |
| -"{"code":"UnsupportedSyntax","message":"\`module\` keyword is not supported. Use \`namespace\` instead.","snippet":"module foo","filename":"test.ts","line":1,"column":8} |
124 |
| -" |
| 173 | +Map { |
| 174 | + "code" => "UnsupportedSyntax", |
| 175 | + "column" => 8, |
| 176 | + "filename" => "test.ts", |
| 177 | + "line" => 1, |
| 178 | + "message" => "\`module\` keyword is not supported. Use \`namespace\` instead.", |
| 179 | + "snippet" => "module foo", |
| 180 | +} |
125 | 181 | `;
|
126 | 182 |
|
127 | 183 | exports[`transform in transform mode should throw an error when it encounters a module 1`] = `
|
128 |
| -"{"code":"UnsupportedSyntax","message":"\`module\` keyword is not supported. Use \`namespace\` instead.","snippet":"module foo","filename":"test.ts","line":1,"column":0} |
129 |
| -" |
| 184 | +Map { |
| 185 | + "code" => "UnsupportedSyntax", |
| 186 | + "column" => 0, |
| 187 | + "filename" => "test.ts", |
| 188 | + "line" => 1, |
| 189 | + "message" => "\`module\` keyword is not supported. Use \`namespace\` instead.", |
| 190 | + "snippet" => "module foo", |
| 191 | +} |
130 | 192 | `;
|
131 | 193 |
|
132 | 194 | exports[`transform should strip types 1`] = `
|
|
0 commit comments