Skip to content

Commit

Permalink
More test
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Jul 4, 2024
1 parent ea00702 commit 06f3f30
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ exports[`transform in strip-only mode should throw an error when it encounters a
"
`;

exports[`transform in strip-only mode should throw an error with a descriptive message when it encounters a decorator 1`] = `
"
x Decorators are not supported
,----
1 | class Foo { @decorator foo() {} }
: ^^^^^^^^^^
\`----
"
`;

exports[`transform in transform mode should transpile enum 1`] = `
"var Foo;
(function(Foo) {})(Foo || (Foo = {}));
Expand Down
8 changes: 8 additions & 0 deletions bindings/binding_typescript_wasm/__tests__/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ describe("transform", () => {
})
).rejects.toMatchSnapshot();
});

it('should throw an error with a descriptive message when it encounters a decorator', async () => {
await expect(
swc.transform("class Foo { @decorator foo() {} }", {
mode: "strip-only",
})
).rejects.toMatchSnapshot();
})
});

describe("in transform mode", () => {
Expand Down

0 comments on commit 06f3f30

Please sign in to comment.