test.js 526 B

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