You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I noticed that when mocking constructors, mockImplementation() will work as I expect (it mocks the implementation), but calling mockImplementationOnce() does not mock the implementation.
You can see the bug here: https://repl.it/MCyG/3 if you change mockImplementationOnce in thing.test.js to mockImplementation, then the test will pass.
What is the expected behavior?
I would expect mockImplementationOnce to work like mockImplementation, except it only mocks it once.
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
macOS 10.13, Jest 21.2.1, Yarn 0.24.5, Node 6.10.2.
The text was updated successfully, but these errors were encountered:
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
Do you want to request a feature or report a bug?
Bug.
What is the current behavior?
So I noticed that when mocking constructors,
mockImplementation()
will work as I expect (it mocks the implementation), but callingmockImplementationOnce()
does not mock the implementation.You can see the bug here: https://repl.it/MCyG/3 if you change
mockImplementationOnce
in thing.test.js tomockImplementation
, then the test will pass.What is the expected behavior?
I would expect
mockImplementationOnce
to work likemockImplementation
, except it only mocks it once.Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
macOS 10.13, Jest 21.2.1, Yarn 0.24.5, Node 6.10.2.
The text was updated successfully, but these errors were encountered: