Closed ericclemmons closed 8 years ago
Here's something that I'd like to do:
var spy = expect.spyOn(require, "resolve").andCall(function(path) { if (path.match(/something/) { return spy.original("fixture_instead.js"); } return spy.andCallThrough(); });
Clearly I just violated half of the API, but didn't know if this was something you'd consider.
You could just save off a reference to require.resolve before you spy on it. I'd rather not include API for this, but if others find it useful as well we would definitely consider it.
require.resolve
Here's something that I'd like to do:
Clearly I just violated half of the API, but didn't know if this was something you'd consider.