async-no-run-queue-multiple.tap.js 627 B

1234567891011121314151617181920212223
  1. var test = require('tap').test
  2. , cls = require('../context.js')
  3. ;
  4. test("minimized test case that caused #6011 patch to fail", function (t) {
  5. t.plan(3);
  6. console.log('+');
  7. // when the flaw was in the patch, commenting out this line would fix things:
  8. process.nextTick(function () { console.log('!'); });
  9. var n = cls.createNamespace("test");
  10. t.ok(!n.get('state'), "state should not yet be visible");
  11. n.run(function () {
  12. n.set('state', true);
  13. t.ok(n.get('state'), "state should be visible");
  14. process.nextTick(function () {
  15. t.ok(n.get('state'), "state should be visible");
  16. });
  17. });
  18. });