make spy decorator

This commit is contained in:
Leo Horie 2016-08-30 14:05:53 -04:00
parent 32fed2dd88
commit f0888ac7bd
2 changed files with 26 additions and 4 deletions

View file

@ -25,8 +25,7 @@ module.exports = new function init() {
spy.args = [].slice.call(arguments)
spy.callCount++
if(fn)
return fn.apply(this, arguments)
if (fn) return fn.apply(this, arguments)
}
spy.args = []
spy.callCount = 0