Skip to content

Commit

Permalink
Update test refs
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Jan 8, 2025
1 parent f035557 commit c9163ff
Showing 1 changed file with 42 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
exports[`transform in strip-only mode should not emit 'Caused by: failed to parse' 1`] = `
{
"code": "InvalidSyntax",
"message": "
x await isn't allowed in non-async function
"message": " x await isn't allowed in non-async function
,----
1 | function foo() { await Promise.resolve(1); }
: ^^^^^^^
Expand Down Expand Up @@ -39,6 +38,32 @@ exports[`transform in strip-only mode should remove declare enum 3`] = `
}
`;
exports[`transform in strip-only mode should report correct error for syntax error 1`] = `
{
"code": "InvalidSyntax",
"message": " x Expected ';', '}' or <eof>
,----
1 | function foo() { invalid syntax }
: ^^^|^^^ ^^^^^^
: \`-- This is the expression part of an expression statement
\`----
",
}
`;
exports[`transform in strip-only mode should report correct error for unsupported syntax 1`] = `
{
"code": "UnsupportedSyntax",
"message": " x TypeScript enum is not supported in strip-only mode
,-[1:1]
1 | ,-> enum Foo {
2 | | a, b
3 | \`-> }
\`----
",
}
`;
exports[`transform in strip-only mode should strip complex expressions 1`] = `
{
"code": "const foo = {
Expand Down Expand Up @@ -93,33 +118,39 @@ exports[`transform in strip-only mode should strip type declarations 1`] = `
`;
exports[`transform in strip-only mode should throw an error when it encounters a module 1`] = `
"
x TypeScript namespace declaration is not supported in strip-only mode
{
"code": "UnsupportedSyntax",
"message": " x TypeScript namespace declaration is not supported in strip-only mode
,----
1 | module foo {}
: ^^^^^^^^^^^^^
\`----
"
",
}
`;
exports[`transform in strip-only mode should throw an error when it encounters a namespace 1`] = `
"
x TypeScript namespace declaration is not supported in strip-only mode
{
"code": "UnsupportedSyntax",
"message": " x TypeScript namespace declaration is not supported in strip-only mode
,----
1 | namespace Foo {}
: ^^^^^^^^^^^^^^^^
\`----
"
",
}
`;
exports[`transform in strip-only mode should throw an error when it encounters an enum 1`] = `
"
x TypeScript enum is not supported in strip-only mode
{
"code": "UnsupportedSyntax",
"message": " x TypeScript enum is not supported in strip-only mode
,----
1 | enum Foo {}
: ^^^^^^^^^^^
\`----
"
",
}
`;
exports[`transform should strip types 1`] = `
Expand Down

0 comments on commit c9163ff

Please sign in to comment.