From 88ffdc5fec9d2f99e891fc6a282c940f08428cfb Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Fri, 13 Jan 2023 12:48:10 -0800 Subject: [TypeScript transpiler] Fix bug with `export default class implements` --- test/bun.js/transpiler.test.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test/bun.js/transpiler.test.js') 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 { + 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;", -- cgit v1.2.3