muk
Usage
Mock dependencies.
foo.js
var request = ; module { // do something with request};
test.js
var { // mock a request here}; var foo = ;
You can also mock modules required with a relative path.
some/where/else/foo.js
var bar = ; module { // do something with bar};
some/where/else/bar.js
exportsattack = 'sludge attack!';
test.js
var foo = ;
Comes with object method mocking too.
var fs = ;var muk = ; ;
Check if member has been mocked.
muk; // true
Restore all mocked methods after tests.
muk; fs;
Install
npm install muk
Tests
Tests are written with mocha
npm test
License
MIT