rewire
rewire copied to clipboard
Rewire on node module with shebang doesn't work.
It works to require a module with a shebang. But rewire doesn't handle it well.
(function (exports, require, module, __filename, __dirname) { var clearInterval = global.clearInterval; var clearTimeout = global.clearTimeout; var setInterval = global.setInterval; var setTimeout = global.setTimeout; var queueMicrotask = global.queueMicrotask; var clearImmediate = global.clearImmediate; var setImmediate = global.setImmediate; var before = global.before; var after = global.after; var beforeEach = global.beforeEach; var afterEach = global.afterEach; var run = global.run; var context = global.context; var describe = global.describe; var xcontext = global.xcontext; var xdescribe = global.xdescribe; var specify = global.specify; var it = global.it; var xspecify = global.xspecify; var xit = global.xit; (function () { #!/usr/bin/node
^
SyntaxError: Invalid or unexpected token