Skip to content

Commit c9163ff

Browse files
committed
Update test refs
1 parent f035557 commit c9163ff

File tree

1 file changed

+42
-11
lines changed

1 file changed

+42
-11
lines changed

bindings/binding_typescript_wasm/__tests__/__snapshots__/transform.js.snap

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
exports[`transform in strip-only mode should not emit 'Caused by: failed to parse' 1`] = `
44
{
55
"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
87
,----
98
1 | function foo() { await Promise.resolve(1); }
109
: ^^^^^^^
@@ -39,6 +38,32 @@ exports[`transform in strip-only mode should remove declare enum 3`] = `
3938
}
4039
`;
4140
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+
4267
exports[`transform in strip-only mode should strip complex expressions 1`] = `
4368
{
4469
"code": "const foo = {
@@ -93,33 +118,39 @@ exports[`transform in strip-only mode should strip type declarations 1`] = `
93118
`;
94119
95120
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
98124
,----
99125
1 | module foo {}
100126
: ^^^^^^^^^^^^^
101127
\`----
102-
"
128+
",
129+
}
103130
`;
104131
105132
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
108136
,----
109137
1 | namespace Foo {}
110138
: ^^^^^^^^^^^^^^^^
111139
\`----
112-
"
140+
",
141+
}
113142
`;
114143
115144
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
118148
,----
119149
1 | enum Foo {}
120150
: ^^^^^^^^^^^
121151
\`----
122-
"
152+
",
153+
}
123154
`;
124155
125156
exports[`transform should strip types 1`] = `

0 commit comments

Comments
 (0)