UNPKG

526 BJavaScriptView Raw
1var test = require("tap").test;
2var nextTick = require('./');
3
4test('should work', function (t) {
5 t.plan(5);
6 nextTick(function (a) {
7 t.ok(a);
8 nextTick(function (thing) {
9 t.equals(thing, 7);
10 }, 7);
11 }, true);
12 nextTick(function (a, b, c) {
13 t.equals(a, 'step');
14 t.equals(b, 3);
15 t.equals(c, 'profit');
16 }, 'step', 3, 'profit');
17});
18
19test('correct number of arguments', function (t) {
20 t.plan(1);
21 nextTick(function () {
22 t.equals(2, arguments.length, 'correct number');
23 }, 1, 2);
24});