Skip to content

Commit

Permalink
Point out you can use matchers in .toMatchObject (jestjs#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 8a4cf01 commit e6b2622
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 e6b2622

Please sign in to comment.