Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changelog and documentation for PR #5503 (Custom asymmetric matchers) #5784

Merged
merged 11 commits into from
Mar 12, 2018
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