Skip to content

Commit

Permalink
Fix t.like() selector type
Browse files Browse the repository at this point in the history
  • Loading branch information
novemberborn committed Jul 4, 2020
1 parent b154612 commit eee2f7b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.d.ts
Expand Up @@ -130,7 +130,7 @@ export interface DeepEqualAssertion {

export interface LikeAssertion {
/** Assert that `value` is like `selector`. */
(value: any, selector: Record<string, unknown>, message?: string): void;
(value: any, selector: Record<string, any>, message?: string): void;

/** Skip this assertion. */
skip(value: any, selector: any, message?: string): void;
Expand Down
10 changes: 9 additions & 1 deletion test-d/like.ts
Expand Up @@ -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);
});

0 comments on commit eee2f7b

Please sign in to comment.