diff options
Diffstat (limited to 'integration/bunjs-only-snippets/transpiler.test.js')
-rw-r--r-- | integration/bunjs-only-snippets/transpiler.test.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/integration/bunjs-only-snippets/transpiler.test.js b/integration/bunjs-only-snippets/transpiler.test.js index f510cef74..34120e2d2 100644 --- a/integration/bunjs-only-snippets/transpiler.test.js +++ b/integration/bunjs-only-snippets/transpiler.test.js @@ -765,6 +765,27 @@ describe("Bun.Transpiler", () => { expectPrinted_("delete foo?.bar?.baz", "delete foo?.bar?.baz"); }); + it("useDefineForConst TypeScript class initialization", () => { + var { expectPrinted_ } = ts; + expectPrinted_( + ` +class Foo { + constructor(public x: string = "hey") {} + bar: number; +} +`.trim(), + ` +class Foo { + x; + constructor(x = "hey") { + this.x = x; + } + bar; +} +`.trim() + ); + }); + it("class static blocks", () => { expectPrinted_( "class Foo { static {} }", |