250721.1 · 8b6498dac2ebef1d1103e25a0b86fbb4cfa3145f
test: strip private properties overload
reading declarations
@@ -312,3 +312,17 @@ test("should preserve import/export type declarations", (t) => { const { code } = transformSync(inputCode); t.assert.snapshot(code); });++test("should strip correctly private properties overload", (t) => {+ const inputCode = `class Private {+ #foo(bar: string): string;+ #foo(bar: number): number;+ #foo(bar: string | number): string | number;+ #foo(bar: string | number): string | number {+ return bar;+ }+ }`;++ const { code } = transformSync(inputCode);+ t.assert.snapshot(code);+});
test/snapshots/index.test.js.snapshot
@@ -58,6 +58,10 @@ exports[`should strip 'satisfies' expressions 1`] = ` "\\n\\t\\tconst user = {\\n\\t\\t\\tname: \\"Alice\\",\\n\\t\\t\\tage: 30,\\n\\t\\t} ;\\n\\t" `; +exports[`should strip correctly private properties overload 1`] = `+"class Private {\\n\\t\\t \\n\\t\\t \\n\\t\\t \\n\\t\\t#foo(bar ) {\\n\\t\\t\\treturn bar;\\n\\t\\t}\\n\\t}"+`;+ exports[`should strip type annotations from arrow functions 1`] = ` "\\n const greet = (name ) => {\\n console.log(name);\\n };\\n " `;