Skip to content

Commit

Permalink
also main docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Jan 17, 2024
1 parent 3bcc8b1 commit 18895d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/ExpectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ Although the `.toBe` matcher **checks** referential identity, it **reports** a d

### `.toHaveBeenCalled()`

Use `.toHaveBeenCalledWith` to ensure that a mock function was called with specific arguments. The arguments are checked with the same algorithm that `.toEqual` uses.
Use `.toHaveBeenCalled` to ensure that a mock function was called.

For example, let's say you have a `drinkAll(drink, flavour)` function that takes a `drink` function and applies it to all available beverages. You might want to check that `drink` gets called for `'lemon'`, but not for `'octopus'`, because `'octopus'` flavour is really weird and why would anything be octopus-flavoured? You can do that with this test suite:

Expand Down

0 comments on commit 18895d8

Please sign in to comment.