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!

8 lines (7 loc) 193 B
var fs = require('fs'); var path = require('path'); module.exports = { foo: function () { fs.renameSync(path.join(__dirname, './some.txt'), path.join(__dirname, './some-FAILURE.txt')); } }