Skip to content

Commit b51c353

Browse files
committed
enhancement(test): Extend method signature overload test to conditional typing
1 parent 59fd876 commit b51c353

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/transformer/descriptor/methods/methods.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,12 @@ describe('for methods', () => {
118118
expect(properties.b).toBe('');
119119
});
120120

121-
it('should use the first overload if any', () => {
121+
it('should use the overload as requested by input', () => {
122122
const properties: InterfaceWithConstructSignatureOverload = createMock<InterfaceWithConstructSignatureOverload>();
123123
// eslint-disable-next-line
124-
expect((new properties() as any).a).toBe(0);
124+
expect((new properties(0)).a).toBe(0);
125+
expect((new properties('')).b).toBe('');
126+
expect((new properties()).c).toBeInstanceOf(Date);
125127
});
126128
});
127129

0 commit comments

Comments
 (0)