Skip to content

Commit 672dfa2

Browse files
authored
docs: update toHaveBeenCalled (#14853)
1 parent cdf089a commit 672dfa2

File tree

6 files changed

+7
-6
lines changed

6 files changed

+7
-6
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
- `[@jest/fake-timers]` Exposing new modern timers function `advanceTimersToFrame()` which advances all timers by the needed milliseconds to execute callbacks currently scheduled with `requestAnimationFrame` ([#14598](https://github.com/jestjs/jest/pull/14598))
2525
- `[jest-matcher-utils]` Add `SERIALIZABLE_PROPERTIES` to allow custom serialization of objects ([#14893](https://github.com/jestjs/jest/pull/14893))
2626
- `[jest-mock]` Add support for the Explicit Resource Management proposal to use the `using` keyword with `jest.spyOn(object, methodName)` ([#14895](https://github.com/jestjs/jest/pull/14895))
27-
- `[jest-reporters]` Add support for [DEC mode 2026](https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036)
27+
- `[jest-reporters]` Add support for [DEC mode 2026](https://gist.github.com/christianparpart/d8a62cc1ab659194337d73e399004036) ([#15008](https://github.com/jestjs/jest/pull/15008))
2828
- `[jest-runtime]` Exposing new modern timers function `jest.advanceTimersToFrame()` from `@jest/fake-timers` ([#14598](https://github.com/jestjs/jest/pull/14598))
2929
- `[jest-runtime]` Support `import.meta.filename` and `import.meta.dirname` (available from [Node 20.11](https://nodejs.org/en/blog/release/v20.11.0)) ([#14854](https://github.com/jestjs/jest/pull/14854))
3030
- `[jest-runtime]` Support `import.meta.resolve` ([#14930](https://github.com/jestjs/jest/pull/14930))
@@ -96,6 +96,7 @@
9696
- `[docs] Append to NODE_OPTIONS, not overwrite ([#14730](https://github.com/jestjs/jest/pull/14730))`
9797
- `[docs]` Updated `.toHaveBeenCalled()` documentation to correctly reflect its functionality ([#14842](https://github.com/jestjs/jest/pull/14842))
9898
- `[docs]` Link NestJS documentation on testing with Jest ([#14940](https://github.com/jestjs/jest/pull/14940))
99+
- `[docs]` `Revised documentation for .toHaveBeenCalled()` to accurately depict its functionality. ([#14853](https://github.com/jestjs/jest/pull/14853))
99100

100101
## 29.7.0
101102

docs/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
Use `.toHaveBeenCalled` to ensure that a mock function was called.
148148

149-
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:
149+
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. You can do that with this test suite:
150150

151151
```js
152152
function drinkAll(callback, flavour) {

website/versioned_docs/version-29.4/ExpectAPI.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Also under the alias: `.toBeCalled()`
148148

149149
Use `.toHaveBeenCalled` to ensure that a mock function was called.
150150

151-
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:
151+
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. You can do that with this test suite:
152152

153153
```js
154154
function drinkAll(callback, flavour) {

website/versioned_docs/version-29.5/ExpectAPI.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Also under the alias: `.toBeCalled()`
148148

149149
Use `.toHaveBeenCalled` to ensure that a mock function was called.
150150

151-
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:
151+
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. You can do that with this test suite:
152152

153153
```js
154154
function drinkAll(callback, flavour) {

website/versioned_docs/version-29.6/ExpectAPI.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Also under the alias: `.toBeCalled()`
148148

149149
Use `.toHaveBeenCalled` to ensure that a mock function was called.
150150

151-
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:
151+
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. You can do that with this test suite:
152152

153153
```js
154154
function drinkAll(callback, flavour) {

website/versioned_docs/version-29.7/ExpectAPI.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Also under the alias: `.toBeCalled()`
148148

149149
Use `.toHaveBeenCalled` to ensure that a mock function was called.
150150

151-
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:
151+
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. You can do that with this test suite:
152152

153153
```js
154154
function drinkAll(callback, flavour) {

0 commit comments

Comments
 (0)