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
Getting this error when attempting to mock a local module: rewiremock('../path/to/my/module') .callThrough() .with({'./another/local/module':stub});
What is overrideBy and when should it be used?
The text was updated successfully, but these errors were encountered:
I resolved this by using this syntax instead: rewiremock.around( () => require('../path/to/my/module'), rewiremock('../another/local/module').with(stub) );
Not exactly sure why that worked though?
overrideBy is just .by(anotherModule)
The error is about using callThrough for an module with a "non-object" export - look like it exports just a function.
PS
rewiremock.around(()=>require('../path/to/my/module'),()=>rewiremock('../another/local/module').with(stub)// this should be a function call);// you can use .proxy to do the samerewiremock.proxy('../path/to/my/module',{'../another/local/module': stub});
Getting this error when attempting to mock a local module:
rewiremock('../path/to/my/module') .callThrough() .with({'./another/local/module':stub});
What is overrideBy and when should it be used?
The text was updated successfully, but these errors were encountered: