Skip to content

Commit

Permalink
Add a success case example of a array-like subset "to satisfy".
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjeffburke committed Jun 22, 2019
1 parent 34035a5 commit c8735b4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions documentation/assertions/any/to-satisfy.md
Expand Up @@ -48,6 +48,14 @@ In order to make statements about a subset of the available indices, an object
specification on the right hand side can mention specific indexes as keys which
are themselves compared using `to satisfy` semantics:

```js
expect([{ greeting: true }, { hey: { there: true } }], 'to satisfy', {
1: { hey: { there: true } }
});
```

In the case of a failing expectation, output such as the following is generated:

```js
expect(['foo', 'catch me', 'baz'], 'to satisfy', { 1: 'bar' });
```
Expand Down

0 comments on commit c8735b4

Please sign in to comment.