stubs
It's a simple stubber.
About
For when you don't want to write the same thing over and over to cache a method and call an override, then revert it, and blah blah.
Use
$ npm install --save-dev stubs
var mylib = require('./lib/index.js')
var stubs = require('stubs')
stubs(mylib, 'create')
stubs(mylib, 'create', function() {
})
stubs(mylib, 'create', true, function() {
})
API
stubs(object, method[[, callthrough], stub])
object
method
Name of the method to stub.
callthrough
Call the original method as well as the stub (if a stub is provided).
stub
If callthrough
is omitted or false
, this method is called in place of the original method. If callthrough
is true
, this method is called after the original method is called as well.