Skip to content

Commit

Permalink
docs: toContain supports Sets as well (#8131)
Browse files Browse the repository at this point in the history
  • Loading branch information
dandv authored and SimenB committed Mar 19, 2019
1 parent 75db174 commit 923bc50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions docs/UsingMatchers.md
Expand Up @@ -117,9 +117,9 @@ test('but there is a "stop" in Christoph', () => {
});
```

## Arrays
## Arrays and iterables

You can check if an array contains a particular item using `toContain`:
You can check if an array or iterable contains a particular item using `toContain`:

```js
const shoppingList = [
Expand All @@ -132,6 +132,7 @@ const shoppingList = [

test('the shopping list has beer on it', () => {
expect(shoppingList).toContain('beer');
expect(new Set(shoppingList)).toContain('beer');
});
```

Expand Down
5 changes: 3 additions & 2 deletions website/versioned_docs/version-22.x/UsingMatchers.md
Expand Up @@ -118,9 +118,9 @@ test('but there is a "stop" in Christoph', () => {
});
```

## Arrays
## Arrays and iterables

You can check if an array contains a particular item using `toContain`:
You can check if an array or iterable contains a particular item using `toContain`:

```js
const shoppingList = [
Expand All @@ -133,6 +133,7 @@ const shoppingList = [

test('the shopping list has beer on it', () => {
expect(shoppingList).toContain('beer');
expect(new Set(shoppingList)).toContain('beer');
});
```

Expand Down

0 comments on commit 923bc50

Please sign in to comment.