UNPKG

require-hijack

Version:

Hijack node require calls, with support for hijacking the entire module itself rather than only its properties. Handy for unit testing and mocking require calls in sub modules!

9 lines (7 loc) 168 B
function Stuff (prop) { throw "Shouldn't call Stuff constructor"; } Stuff.prototype.foo = function () { throw "Shouldn't call Stuff foo."; } module.exports = Stuff;