Skip to content

Commit 8c78a08

Browse files
authored
Docs: Update .toHaveBeenCalled() documentation (#14847)
1 parent f974e01 commit 8c78a08

File tree

6 files changed

+6
-5
lines changed

6 files changed

+6
-5
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
- `[jest-transform]` Upgrade `write-file-atomic` ([#14274](https://github.com/jestjs/jest/pull/14274))
7575
- `[jest-util]` Upgrade `picomatch` to v3 ([#14653](https://github.com/jestjs/jest/pull/14653))
7676
- `[docs] Append to NODE_OPTIONS, not overwrite ([#14730](https://github.com/jestjs/jest/pull/14730))`
77+
- `[docs]` Updated `.toHaveBeenCalled()` documentation to correctly reflect its functionality ([#14842](https://github.com/jestjs/jest/pull/14842))
7778

7879
## 29.7.0
7980

docs/ExpectAPI.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Although the `.toBe` matcher **checks** referential identity, it **reports** a d
144144

145145
### `.toHaveBeenCalled()`
146146

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

149149
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:
150150

website/versioned_docs/version-29.4/ExpectAPI.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Although the `.toBe` matcher **checks** referential identity, it **reports** a d
146146

147147
Also under the alias: `.toBeCalled()`
148148

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

151151
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:
152152

website/versioned_docs/version-29.5/ExpectAPI.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Although the `.toBe` matcher **checks** referential identity, it **reports** a d
146146

147147
Also under the alias: `.toBeCalled()`
148148

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

151151
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:
152152

website/versioned_docs/version-29.6/ExpectAPI.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Although the `.toBe` matcher **checks** referential identity, it **reports** a d
146146

147147
Also under the alias: `.toBeCalled()`
148148

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

151151
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:
152152

website/versioned_docs/version-29.7/ExpectAPI.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Although the `.toBe` matcher **checks** referential identity, it **reports** a d
146146

147147
Also under the alias: `.toBeCalled()`
148148

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

151151
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:
152152

0 commit comments

Comments
 (0)