mirror of
https://github.com/hanzoai/jest.git
synced 2026-09-24 16:59:57 +00:00
docs: update reported error text (#8533)
this matches more what is being reported. Especially the bit about `"mockedFunction"` is important, because otherwise it's a bit confusing what `mockName` will help with.
This commit is contained in:
committed by
Tim Seckinger
parent
6590a99fd5
commit
dfd05585d6
@@ -188,10 +188,10 @@ expect(mockFn).toHaveBeenCalled();
|
||||
|
||||
Will result in this error:
|
||||
|
||||
```bash
|
||||
expect(mockedFunction).toHaveBeenCalled()
|
||||
```
|
||||
expect(mockedFunction).toHaveBeenCalled()
|
||||
|
||||
Expected mock function to have been called.
|
||||
Expected mock function "mockedFunction" to have been called, but it was not called.
|
||||
```
|
||||
|
||||
### `mockFn.mockReturnThis()`
|
||||
|
||||
@@ -157,9 +157,9 @@ expect(mockFn).toHaveBeenCalled();
|
||||
Will result in this error:
|
||||
|
||||
```
|
||||
expect(mockedFunction).toHaveBeenCalled()
|
||||
expect(mockedFunction).toHaveBeenCalled()
|
||||
|
||||
Expected mock function to have been called.
|
||||
Expected mock function "mockedFunction" to have been called, but it was not called.
|
||||
```
|
||||
|
||||
### `mockFn.mockReturnThis()`
|
||||
|
||||
@@ -183,10 +183,10 @@ expect(mockFn).toHaveBeenCalled();
|
||||
|
||||
Will result in this error:
|
||||
|
||||
```bash
|
||||
expect(mockedFunction).toHaveBeenCalled()
|
||||
```
|
||||
expect(mockedFunction).toHaveBeenCalled()
|
||||
|
||||
Expected mock function to have been called.
|
||||
Expected mock function "mockedFunction" to have been called, but it was not called.
|
||||
```
|
||||
|
||||
### `mockFn.mockReturnThis()`
|
||||
|
||||
@@ -189,10 +189,10 @@ expect(mockFn).toHaveBeenCalled();
|
||||
|
||||
Will result in this error:
|
||||
|
||||
```bash
|
||||
expect(mockedFunction).toHaveBeenCalled()
|
||||
```
|
||||
expect(mockedFunction).toHaveBeenCalled()
|
||||
|
||||
Expected mock function to have been called.
|
||||
Expected mock function "mockedFunction" to have been called, but it was not called.
|
||||
```
|
||||
|
||||
### `mockFn.mockReturnThis()`
|
||||
|
||||
Reference in New Issue
Block a user