Please forgive me if I've missed something, but I would like to use proxyquire to mock multiple modules, let me give an example.
// JS File:
var one = require('one');
var two = require('two');
function doStuff(args){
var thing = two(args);
return one(thing);
}
module.exports.doStuff = doStuff;
// Test file
var doStuff = proxyQuire('./doStuff.js', [
{'one': oneStub },
{'two': twoStub }
]);
// do tests down here
While reading the docs and looking at examples it doesn't seem like proxyquire is set up to work like this. I've tried this in my test anyways and it didn't seem to work.
Hi,
Please forgive me if I've missed something, but I would like to use proxyquire to mock multiple modules, let me give an example.
While reading the docs and looking at examples it doesn't seem like proxyquire is set up to work like this. I've tried this in my test anyways and it didn't seem to work.
Any ideas?
Thanks!