mock-knex
mock-knex copied to clipboard
Protect replace from modifying the prototype
trafficstars
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 #126