must-call
Version:
example.on('end', mustCall(() => {})); Check the callback function is called.
25 lines (18 loc) • 857 B
Markdown
must-call
==================
[](https://badge.fury.io/js/must-call)
[](https://travis-ci.org/yosuke-furukawa/must-call)
[](https://coveralls.io/github/yosuke-furukawa/must-call?branch=master)
`must-call` is an assertion library for async test.
This method is inspired from `node.js` project `test/common.js`.
```js
const mustCall = require('must-call');
someCallback(mustCall(() => {
// when callback does not called at the end of the process,
// throw exception.
}));
somePromiseTest().then(mustCall(() => {
// when async test does not resolved at the end of the process,
// throw exception.
}));
```