0.6.0 / 2015-04-24
Added .spy.on
and .spy.object
to easily make new spies, for example:
// Returns `fs` but with readFile and readFileSync spied on
var fs = chai.spy.object(fs, ['readFile', 'readFileSync']);
// Shortcut for `fs.writeFile = chai.spy(fs.writeFile)`
chai.spy.on(fs, 'writeFile');
Added new assertions:
.called.min(n)/.at.least(n)
to assert a spy has been called a minimum of
n
many times..called.max(n)/.at.most(n)
to assert that a spy has been called at mostn
number of times.
Community Contributions
Code Features & Fixes
- #9 Add support for component
By @pgherveou - #15 Add
above
/below
/at.most
/
at.least
call count assertions.
By @brandonhorst - #20 Fix output for
.called()
By @Ryckes - #21 Add
.spy.on
and.spy.object
methods.
By @stalniy