nested-async-plan-noend.js 716 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. 'use strict';
  2. var test = require('../');
  3. test('Harness async test support', function (t) {
  4. t.plan(3);
  5. t.ok(true, 'sync child A');
  6. t.test('sync child B', function (tt) {
  7. tt.plan(2);
  8. setTimeout(function () {
  9. tt.test('async grandchild A', function (ttt) {
  10. ttt.plan(1);
  11. ttt.ok(true);
  12. });
  13. }, 50);
  14. setTimeout(function () {
  15. tt.test('async grandchild B', function (ttt) {
  16. ttt.plan(1);
  17. ttt.ok(true);
  18. });
  19. }, 100);
  20. });
  21. setTimeout(function () {
  22. t.test('async child', function (tt) {
  23. tt.plan(2);
  24. tt.ok(true, 'sync grandchild in async child A');
  25. tt.test('sync grandchild in async child B', function (ttt) {
  26. ttt.plan(1);
  27. ttt.ok(true);
  28. });
  29. });
  30. }, 200);
  31. });