expectType doesn't work properly with generic functions. Here's a repro:
import {expectType} from 'tsd'
declare const inferrable: <T = 'SomeDefaultValue'>() => T
expectType<number>(inferrable()) // passes, should fail
I'm not sure if it's possible to fix given the API design, but here's the same test using expect-type which fails as it should.
import {expectTypeOf} from 'expect-type'
declare const inferrable: <T = 'SomeDefaultValue'>() => T
expectTypeOf(inferrable()).toEqualTypeOf<number>() // fails as expected, because `inferrable()` returns type `'SomeDefaultValue'`
From #142:
Adds a reproduction test case: