Skip to content

Instantly share code, notes, and snippets.

@mateodelnorte
Created May 17, 2013 22:05
Show Gist options
  • Save mateodelnorte/5602304 to your computer and use it in GitHub Desktop.
Save mateodelnorte/5602304 to your computer and use it in GitHub Desktop.
module.exports = { test: 2 };
var dep2 = require('./dep2'),
dep3 = require('./dep3');
module.exports.one = { test: 1 };
module.exports.two = dep2;
module.exports.three = dep3;
module.exports = { test: 3 }
var mr = require('mockrequire');
var dep = mr('./dep', {
'./dep2': { test: 3 }
});
console.log(dep.one);
console.log(dep.two);
console.log(dep.three);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment