-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
nodejs/nodejs.org
#7779Labels
docIssues and PRs related to the documentations.Issues and PRs related to the documentations.
Description
Affected URL(s)
https://nodejs.org/en/learn/test-runner/mocking
Description of the problem
The example given "Modules + units" uses a call to mock.fn() without any parameters, causing " barMock.mockImplementationOnce" to fail later on.
I am not sure if the example is only for demonstration purposes but I tried to run it :)
const barMock = mock.fn();
Later on it calls:
barMock.mockImplementationOnce(function bar_mock() {
/* … */
});
Since the barMock function did not receive a function parameter above, the call to barMock.mockImplementationOnce fails.
Metadata
Metadata
Assignees
Labels
docIssues and PRs related to the documentations.Issues and PRs related to the documentations.