diff --git a/index.d.ts b/index.d.ts index 029921567..8bd9a58e2 100644 --- a/index.d.ts +++ b/index.d.ts @@ -130,7 +130,7 @@ export interface DeepEqualAssertion { export interface LikeAssertion { /** Assert that `value` is like `selector`. */ - (value: any, selector: Record, message?: string): void; + (value: any, selector: Record, message?: string): void; /** Skip this assertion. */ skip(value: any, selector: any, message?: string): void; diff --git a/test-d/like.ts b/test-d/like.ts index d5b9a18b0..5dd772c4d 100644 --- a/test-d/like.ts +++ b/test-d/like.ts @@ -13,5 +13,13 @@ test('like', t => { baz: 'thud' } }); -}); + type Foo = { + foo?: 'foo'; + bar?: 'bar'; + }; + + const foo: Foo = {bar: 'bar'}; + const {foo: _, ...expected} = foo; + t.like({bar: 'bar'}, expected); +});