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
Yeah, I it's probably because require.resolve will resolve relative to the calling file, which is patch.js, not the file where patch() was called from. The fix is probably as simple as detecting a relative path and prepending '../../' to it or something. If I get to fix it this weekend, I'll send you a pull request.
Looks like fixing that would break the API as well, haha. I just found Sinon, too. It looks awesome. Looks like it's got all the features I imagined for SuperMock plus a lot more. I'll be using it for my projects from now on. Good luck with SuperMock.
Hi, Russ.
Is it not possible to patch modules loaded from a relative path (e.g.
require('./foo')
orrequire('../src/bar')
)? If not, is there a reason for it?Thanks.
P.S.: I tried adding a 'question' tag to this issue, but I couldn't find it. Not sure if GitHub is buggy today or if you disabled it ^_^
The text was updated successfully, but these errors were encountered: