Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test
  • Loading branch information
aymericbouzy committed Feb 9, 2018
commit ec544110a871d505f4e4229d4a5868c05f6eacf0
8 changes: 8 additions & 0 deletions packages/expect/src/__tests__/extend.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,11 @@ it('exposes an equality function to custom matchers', () => {

expect(() => jestExpect().toBeOne()).not.toThrow();
});

it('defines asymmetric matchers', () => {
jestExpect({value: 2}).toEqual({value: expect.toBeDivisibleBy(2)});
jestExpect({value: 3}).toEqual({value: expect.not.toBeDivisibleBy(2)});
expect(() =>
jestExpect({value: 3}).toEqual({value: expect.toBeDivisibleBy(2)}),
).toThrowErrorMatchingSnapshot();
});