mfncooper / mockery

Simplifying the use of mocks with Node.js
Other
1.1k stars 60 forks source link

Mock destructuring dependency #78

Closed pcarvajal closed 1 year ago

pcarvajal commented 1 year ago

I want to mock the following destructured dependency

const { func } = require('../some/path');

I register the mock

mockery.registerMock('../some/path', { func: () => true });

but at the time of replacing the function, it is on hold

Any ideas?

pcarvajal commented 1 year ago

I have .js in the dependency path