Skip to content

Commit

Permalink
Pass require.extensions to resolve when finding stubs (eg .coffee)
Browse files Browse the repository at this point in the history
Closes #124
  • Loading branch information
bendrucker committed May 10, 2016
1 parent 383afdf commit f326ae6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/proxyquire.js
Expand Up @@ -185,7 +185,8 @@ Proxyquire.prototype._withoutCache = function(module, stubs, path, func) {
var id = Module._resolveFilename(path, module);
var stubIds = Object.keys(stubs).map(function (stubPath) {
return resolve.sync(stubPath, {
basedir: dirname(id)
basedir: dirname(id),
extensions: Object.keys(require.extensions)
})
});
var ids = [id].concat(stubIds);
Expand Down

0 comments on commit f326ae6

Please sign in to comment.