jack-expect
Synopsis
Expect.js assertions for Jack.js test doubles
Usage
// Setup: var expect = ; expect;
// subject: var out = {} {}; // test double ;
testDouble
Verify that a function is a test double.
tobe;tonotbe;
invoked
Verify that a test double has been invoked.
;not;
max
Verify that a test double has been called max n
times.
;not;
min
Verify that a test double has been called min n
times.
;not;
exactly
Verify that a test double has been called exactly n
times.
;not;
once
Verify that a test double has been called exactly once.
;not;
twice
Verify that a test double has been called exactly twice.
;not;
on
Verify that a test double has been called on given context.
;not;
args/withArgs
Verify that a test double has been called with given arguments.
;not;
Installation
npm:
npm install jack-expect
component:
component install jackjs/jack-expect
Standalone:
Tests
$ npm test
Coverage:
$ npm run coverage
License
(The MIT License)
Copyright (c) 2013 Veselin Todorov hi@vesln.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.