Skip to content

Commit

Permalink
docs: incorrect specification to the method jest.replaceProperty (#14388
Browse files Browse the repository at this point in the history
)
  • Loading branch information
vinicinbgs authored Aug 16, 2023
1 parent 0cbe04d commit dde57f7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ Creates a mock function similar to `jest.fn` but also tracks calls to `object[me

:::note

By default, `jest.spyOn` also calls the **spied** method. This is different behavior from most other test libraries. If you want to overwrite the original function, you can use `jest.spyOn(object, methodName).mockImplementation(() => customImplementation)` or `jest.replaceProperty(object, methodName, jest.fn(() => customImplementation));`
By default, `jest.spyOn` also calls the **spied** method. This is different behavior from most other test libraries. If you want to overwrite the original function, you can use `jest.spyOn(object, methodName).mockImplementation(() => customImplementation)` or `object[methodName] = jest.fn(() => customImplementation)`.

:::

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-29.4/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ Creates a mock function similar to `jest.fn` but also tracks calls to `object[me

:::note

By default, `jest.spyOn` also calls the **spied** method. This is different behavior from most other test libraries. If you want to overwrite the original function, you can use `jest.spyOn(object, methodName).mockImplementation(() => customImplementation)` or `jest.replaceProperty(object, methodName, jest.fn(() => customImplementation));`
By default, `jest.spyOn` also calls the **spied** method. This is different behavior from most other test libraries. If you want to overwrite the original function, you can use `jest.spyOn(object, methodName).mockImplementation(() => customImplementation)` or `object[methodName] = jest.fn(() => customImplementation)`.

:::

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-29.5/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ Creates a mock function similar to `jest.fn` but also tracks calls to `object[me

:::note

By default, `jest.spyOn` also calls the **spied** method. This is different behavior from most other test libraries. If you want to overwrite the original function, you can use `jest.spyOn(object, methodName).mockImplementation(() => customImplementation)` or `jest.replaceProperty(object, methodName, jest.fn(() => customImplementation));`
By default, `jest.spyOn` also calls the **spied** method. This is different behavior from most other test libraries. If you want to overwrite the original function, you can use `jest.spyOn(object, methodName).mockImplementation(() => customImplementation)` or `object[methodName] = jest.fn(() => customImplementation)`.

:::

Expand Down
2 changes: 1 addition & 1 deletion website/versioned_docs/version-29.6/JestObjectAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ Creates a mock function similar to `jest.fn` but also tracks calls to `object[me

:::note

By default, `jest.spyOn` also calls the **spied** method. This is different behavior from most other test libraries. If you want to overwrite the original function, you can use `jest.spyOn(object, methodName).mockImplementation(() => customImplementation)` or `jest.replaceProperty(object, methodName, jest.fn(() => customImplementation));`
By default, `jest.spyOn` also calls the **spied** method. This is different behavior from most other test libraries. If you want to overwrite the original function, you can use `jest.spyOn(object, methodName).mockImplementation(() => customImplementation)` or `object[methodName] = jest.fn(() => customImplementation)`.

:::

Expand Down

0 comments on commit dde57f7

Please sign in to comment.