Skip to content
forked from tsdjs/tsd

Commit

Permalink
Add tests (tsdjs#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy-mitchell committed Sep 15, 2022
1 parent 81fe00d commit 8a513ee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions source/test/fixtures/expect-error/generics/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ export default one;

export function two<T1>(foo: T1): T1;
export function two<T1, T2, T3 extends T2>(foo: T1, bar: T2): T3;

export const inferrable: <T = 'SomeDefaultValue'>() => T;
8 changes: 6 additions & 2 deletions source/test/fixtures/expect-error/generics/index.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import {expectError} from '../../../..';
import one, {two} from '.';
import {expectError, expectType} from '../../../..';
import one, {two, inferrable} from '.';

expectError(one(true, true));

expectError(one<number>(1, 2));

expectError(two<number, string>(1, 'bar'));

expectError(expectType<number>(inferrable<true>()));

expectError(expectType<number>(inferrable()));

0 comments on commit 8a513ee

Please sign in to comment.