-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unmock does not work correctly #126
Comments
At the moment I'm using following quickfix
|
Hey, I'm having a similar issue with |
mock(Knex) is storing the original functions on a replacement object, but when being set lodash is storing it on the real object prototype. This change modifies the replacement storage to put the function on a renamed prototype object much like the constructor. This allows unmock(Knex) to properly restore all mocked functions. Fixes jbrumwell#126
I opened an MR to fix this. If you want to monkey-patch it yourself, you can use this code (tested only with v0.4.11)
|
We only started experiencing this error when we introduced |
The
unmock
method does not work as expected. I would expect to have the original client working as it would never have been mocked.After
unmock
the client always throw an error on executing a query:I'm using
mock-knex v0.4.9
knex v0.21.19
Here is a code example to get the error
If you remove the
mock
andunmock
lines the query works.The text was updated successfully, but these errors were encountered: