API/api.medcify.app/node_modules/continuation-local-storage/test/async-no-run-queue-multiple.tap.js

24 lines
627 B
JavaScript
Raw Normal View History

2022-09-26 06:11:44 +00:00
var test = require('tap').test
, cls = require('../context.js')
;
test("minimized test case that caused #6011 patch to fail", function (t) {
t.plan(3);
console.log('+');
// when the flaw was in the patch, commenting out this line would fix things:
process.nextTick(function () { console.log('!'); });
var n = cls.createNamespace("test");
t.ok(!n.get('state'), "state should not yet be visible");
n.run(function () {
n.set('state', true);
t.ok(n.get('state'), "state should be visible");
process.nextTick(function () {
t.ok(n.get('state'), "state should be visible");
});
});
});