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:
Michael Weibel
2019-06-06 15:41:09 +02:00
committed by Tim Seckinger
parent 6590a99fd5
commit dfd05585d6
4 changed files with 11 additions and 11 deletions
+3 -3
View File
@@ -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()`