diff --git a/test/types.test.ts b/test/types.test.ts index b7d364e..b1f47f4 100644 --- a/test/types.test.ts +++ b/test/types.test.ts @@ -714,3 +714,20 @@ test('PrintType', () => { expectTypeOf {}>>().toEqualTypeOf<'function'>() expectTypeOf>().toBeNever() }) + +test('Issue #53: `.omit()` should work similarly to `Omit`', () => { + // https://github.com/mmkal/expect-type/issues/53 + + type Loading = { + state: 'loading' + } + + type Failed = { + state: 'failed' + code: number + } + + expectTypeOf>().toEqualTypeOf<{state: 'loading' | 'failed'}>() + + expectTypeOf().omit<'code'>().toEqualTypeOf<{state: 'loading' | 'failed'}>() +})