Skip to content

Commit

Permalink
Changed tests to pass with typescript@next (v5.4)
Browse files Browse the repository at this point in the history
  • Loading branch information
timocov committed Dec 27, 2023
1 parent f0f0c21 commit 2d3e710
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
8 changes: 8 additions & 0 deletions tests/e2e/test-cases/primitive-generation/func.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export type TypeName = string | number;

export interface InterfaceName {
prop: number;
prop2: TypeName;
}

export declare function func2({ prop: prop3 }?: InterfaceName): TypeName;
11 changes: 4 additions & 7 deletions tests/e2e/test-cases/primitive-generation/input.ts
Original file line number Diff line number Diff line change
@@ -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 };
3 changes: 2 additions & 1 deletion tests/e2e/test-cases/primitive-generation/output.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};

0 comments on commit 2d3e710

Please sign in to comment.