Skip to content

Commit

Permalink
Changelog and documentation for PR #5503 (Custom asymmetric matchers) (
Browse files Browse the repository at this point in the history
…#5784)

* test

* define asymmetric matchers

* more

* correction

* trying to fix flow

* flow fix

* Changelog

* add example in documentation
  • Loading branch information
aymericbouzy authored and rickhanlonii committed Mar 12, 2018
1 parent 620bdca commit 9cb1a5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
([#5670](https://github.com/facebook/jest/pull/5670))
* `[expect]` Add inverse matchers (`expect.not.arrayContaining`, etc.,
[#5517](https://github.com/facebook/jest/pull/5517))
* `[expect]` `expect.extend` now also extends asymmetric matchers
([#5503](https://github.com/facebook/jest/pull/5503))
* `[jest-mock]` Update `spyOnProperty` to support spying on the prototype chain
([#5753](https://github.com/facebook/jest/pull/5753))
* `[jest-mock]` Add tracking of return values in the `mock` property
Expand Down
4 changes: 4 additions & 0 deletions docs/ExpectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ expect.extend({
test('even and odd numbers', () => {
expect(100).toBeDivisibleBy(2);
expect(101).not.toBeDivisibleBy(2);
expect({apples: 6, bananas: 3}).toEqual({
apples: expect.toBeDivisibleBy(2),
bananas: expect.not.toBeDivisibleBy(2),
});
});
```

Expand Down

0 comments on commit 9cb1a5c

Please sign in to comment.