Skip to content

Commit

Permalink
Point out you can use matchers in .toMatchObject (#3796)
Browse files Browse the repository at this point in the history
  • Loading branch information
dandv authored and cpojer committed Jun 12, 2017
1 parent e1da40b commit fed01f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/en/ExpectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ describe('grapefruits are healthy', () => {

### `.toMatchObject(object)`

Use `.toMatchObject` to check that a JavaScript object matches a subset of the properties of an object.
Use `.toMatchObject` to check that a JavaScript object matches a subset of the properties of an object. You can match properties against values or against matchers.

```js
const houseForSale = {
Expand All @@ -723,7 +723,7 @@ const desiredHouse = {
bath: true,
kitchen: {
amenities: ['oven', 'stove', 'washer'],
wallColor: 'white',
wallColor: expect.stringMatching(/white|yellow/),
},
};

Expand Down

0 comments on commit fed01f2

Please sign in to comment.