From 2d3e71079b80cb31c8c332e629f1ded85be6a0ba Mon Sep 17 00:00:00 2001 From: Evgeniy Timokhov Date: Wed, 27 Dec 2023 11:23:23 +0000 Subject: [PATCH] Changed tests to pass with typescript@next (v5.4) --- tests/e2e/test-cases/primitive-generation/func.d.ts | 8 ++++++++ tests/e2e/test-cases/primitive-generation/input.ts | 11 ++++------- tests/e2e/test-cases/primitive-generation/output.d.ts | 3 ++- 3 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 tests/e2e/test-cases/primitive-generation/func.d.ts diff --git a/tests/e2e/test-cases/primitive-generation/func.d.ts b/tests/e2e/test-cases/primitive-generation/func.d.ts new file mode 100644 index 0000000..8343a1b --- /dev/null +++ b/tests/e2e/test-cases/primitive-generation/func.d.ts @@ -0,0 +1,8 @@ +export type TypeName = string | number; + +export interface InterfaceName { + prop: number; + prop2: TypeName; +} + +export declare function func2({ prop: prop3 }?: InterfaceName): TypeName; diff --git a/tests/e2e/test-cases/primitive-generation/input.ts b/tests/e2e/test-cases/primitive-generation/input.ts index 287c716..f7d2e01 100644 --- a/tests/e2e/test-cases/primitive-generation/input.ts +++ b/tests/e2e/test-cases/primitive-generation/input.ts @@ -1,10 +1,7 @@ -export type TypeName = string | number; +import { InterfaceName, TypeName, func2 } from './func'; -export interface InterfaceName { - prop: number; - prop2: TypeName; +export function func({ prop }: InterfaceName = { prop: 1, prop2: 1 }): TypeName { + throw new Error('it does not matter' + prop); } -export function func({ prop: prop3 }: InterfaceName = { prop: 1, prop2: 1 }): TypeName { - throw new Error('it does not matter' + prop3); -} +export { func2 }; diff --git a/tests/e2e/test-cases/primitive-generation/output.d.ts b/tests/e2e/test-cases/primitive-generation/output.d.ts index 0b88bd9..6183869 100644 --- a/tests/e2e/test-cases/primitive-generation/output.d.ts +++ b/tests/e2e/test-cases/primitive-generation/output.d.ts @@ -3,6 +3,7 @@ export interface InterfaceName { prop: number; prop2: TypeName; } -export declare function func({ prop: prop3 }?: InterfaceName): TypeName; +export declare function func2({ prop: prop3 }?: InterfaceName): TypeName; +export declare function func({ prop }?: InterfaceName): TypeName; export {};