Skip to content

Commit

Permalink
doc: add how to test for undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
unional committed Jan 28, 2019
1 parent 27e906d commit c4dad35
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ createSatisfier({ a: undefined }).test({})
createSatisfier([undefined, 1]).test(['x', 1])
```

If you want to test for `undefined` explicitly, use predicate function.

```ts
createSatisfier(x => x === undefined).test(undefined)
```

## test against array

There are several ways to test against array:
Expand All @@ -83,7 +89,6 @@ If the subject array is longer than the expectation array,
the extra entries are not tested.

You can also skip over entries by putting in `undefined`.
If you want to test against `undefined` explicitely, use a predicate function.

```ts
import { createSatisfier } from 'satisfier'
Expand Down

0 comments on commit c4dad35

Please sign in to comment.