Skip to content

Latest commit

 

History

History
69 lines (51 loc) · 1.81 KB

README.md

File metadata and controls

69 lines (51 loc) · 1.81 KB

pedding

NPM version Node.js CI Test coverage npm download Node.js Version PRs Welcome

Useful tools for unit test: Just pending for callback.

Installation

Node.js

npm install pedding

Usage

CommonJS

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

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

MIT

Contributors

Contributors

Made with contributors-img.