Skip to content

Commit

Permalink
Updating the docs to show array selection with toHaveProperty Matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
iifawzi committed Nov 28, 2021
1 parent 3ed1577 commit e3515c3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/ExpectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,16 @@ const houseForSale = {
wallColor: 'white',
'nice.oven': true,
},
livingroom: {
amenities: [
{
'couch': [
['large', { dimensions: [20,20] }],
['small', { dimensions: [10,10] }],
]
},
]
},
'ceiling.height': 2,
};

Expand Down Expand Up @@ -922,6 +932,7 @@ test('this house has my desired features', () => {
['oven', 'stove', 'washer'],
);
expect(houseForSale).toHaveProperty(['kitchen', 'amenities', 0], 'oven');
expect(houseForSale).toHaveProperty(['livingroom.amenities[0].couch[0][1].dimensions[0]'], '20');
expect(houseForSale).toHaveProperty(['kitchen', 'nice.oven']);
expect(houseForSale).not.toHaveProperty(['kitchen', 'open']);

Expand Down

0 comments on commit e3515c3

Please sign in to comment.