pedding
Version:
Just pending for callback.
70 lines (51 loc) • 1.86 kB
Markdown
[![NPM version][npm-image]][npm-url]
[](https://github.com/node-modules/pedding/actions/workflows/nodejs.yml)
[![Test coverage][codecov-image]][codecov-url]
[![npm download][download-image]][download-url]
[](https://nodejs.org/en/download/)
[](https://makeapullrequest.com)
[]: https://img.shields.io/npm/v/pedding.svg?style=flat-square
[]: https://npmjs.org/package/pedding
[]: https://codecov.io/github/node-modules/pedding/coverage.svg?branch=master
[]: https://codecov.io/github/node-modules/pedding?branch=master
[]: https://img.shields.io/npm/dm/pedding.svg?style=flat-square
[]: https://npmjs.org/package/pedding
Useful tools for unit test: Just pending for callback.
```bash
npm install pedding
```
CommonJS
```js
const { pending } = require('pedding');
it('should request two resources', done => {
done = pending(2, done);
http.get('http://fengmk2.github.com', res => {
done();
});
http.get('http://www.taobao.com', res => {
done();
});
});
```
ESM and TypeScript
```ts
import { pending } from 'pedding';
it('should request two resources', done => {
done = pending(2, done);
http.get('http://fengmk2.github.com', res => {
done();
});
http.get('http://www.taobao.com', res => {
done();
});
});
```
[](LICENSE)
[](https://github.com/node-modules/pedding/graphs/contributors)
Made with [contributors-img](https://contrib.rocks).