0.1.2-1 • Published 11 years ago

assert-called v0.1.2-1

Weekly downloads
56
License
-
Repository
github
Last release
11 years ago

assert-called Build Status

Assert that your callback got called.

Installation

npm install assert-called

Usage

var cb = require('assert-called');

function notCalling(cb) {
}

function notCalled() {
}

process.nextTick(cb(function () {
  console.log('called');
}));

notCalling(cb(notCalled));

Will output:

called

/Users/maciej/dev/js/assert-called/lib/assert-called.js:20
    throw new assert.AssertionError({
          ^
AssertionError: 1 callback not called:
  notCalled

How it works

assert-called attaches a process.on('exit') listener to make sure that all registered callbacks are eventually called.

0.1.2-1

11 years ago

0.1.2

12 years ago

0.1.1

12 years ago

0.1.0

12 years ago

0.0.1

12 years ago