Package detail

pedding

node-modules6.7kMIT2.0.1

Just pending for callback.

pedding, pending, callback

readme

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.

changelog

Changelog

2.0.1 (2025-01-01)

Bug Fixes

  • support pending(fn: Callback, n: number) (#7) (e058f36)

2.0.0 (2024-12-22)

⚠ BREAKING CHANGES

  • drop Node.js < 18.19.0 support

part of https://github.com/eggjs/egg/issues/3644

https://github.com/eggjs/egg/issues/5257

Summary by CodeRabbit

  • New Features
  • Introduced new workflows for continuous integration, package publishing, and release management.
  • Added TypeScript support with a new configuration file and strict type-checking.
  • New pending function implemented for managing callback execution limits.

  • Bug Fixes

  • Corrected function name from pedding to pending in usage examples.

  • Documentation

    • Updated README.md with new badges and improved usage examples.
    • Added MIT License to the project.
  • Chores

  • Removed outdated files and configurations, including .jshintignore, .travis.yml, AUTHORS, and component.json.

Features

  • support cjs and esm both by tshy (#6) (d2352dc)

1.1.0 / 2016-11-11

  • feat: add call stack to error object (#5)
  • use npm scripts
  • add authors
  • remove 0.8

1.0.0 / 2014-07-05

  • support pedding(done, 100) format
  • add npm image
  • add component deps
  • ensure build before test start
  • add component test on npm test
  • add travis

0.0.3 / 2013-07-02

  • add component support

0.0.2 / 2013-06-22

  • fixed #1 done more then giving should throw error