aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/transpiler.test.js
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-01-13 12:48:10 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-01-13 12:48:10 -0800
commit88ffdc5fec9d2f99e891fc6a282c940f08428cfb (patch)
tree7157acfad0165ab242b1844dd3d169d41a8390b7 /test/bun.js/transpiler.test.js
parentfab42148e45572c929efd69f0a818eb972b96225 (diff)
downloadbun-88ffdc5fec9d2f99e891fc6a282c940f08428cfb.tar.gz
bun-88ffdc5fec9d2f99e891fc6a282c940f08428cfb.tar.zst
bun-88ffdc5fec9d2f99e891fc6a282c940f08428cfb.zip
[TypeScript transpiler] Fix bug with `export default class implements`
Diffstat (limited to 'test/bun.js/transpiler.test.js')
-rw-r--r--test/bun.js/transpiler.test.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/bun.js/transpiler.test.js b/test/bun.js/transpiler.test.js
index 94c3d52d2..05607091a 100644
--- a/test/bun.js/transpiler.test.js
+++ b/test/bun.js/transpiler.test.js
@@ -106,6 +106,31 @@ describe("Bun.Transpiler", () => {
ts.expectPrinted_("export = {foo: 123}", "module.exports = { foo: 123 }");
});
+ it("export default class implements TypeScript regression", () => {
+ expect(
+ transpiler
+ .transformSync(
+ `
+ export default class implements ITest {
+ async* runTest(path: string): AsyncGenerator<number> {
+ yield Math.random();
+ }
+ }
+ `,
+ "ts",
+ )
+ .trim(),
+ ).toBe(
+ `
+export default class {
+ async* runTest(path) {
+ yield Math.random();
+ }
+}
+ `.trim(),
+ );
+ });
+
it("satisfies", () => {
ts.expectPrinted_(
"const t1 = { a: 1 } satisfies I1;",