Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! src: add callback scope for native immediates
  • Loading branch information
addaleax committed Jul 14, 2020
commit 1309b616d73842a162ebbed1fbe43388a966efa0
16 changes: 9 additions & 7 deletions test/async-hooks/test-late-hook-enable.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ const fnsToTest = [setTimeout, (cb) => {
});
});
}, (cb) => {
process.nextTick(() => {
cb();
setImmediate(() => {
process.nextTick(() => {
cb();

// We need to keep the event loop open for this to actually work
// since destroy hooks are triggered in unrefed Immediates
setImmediate(() => {
hook.disable();
assert.strictEqual(fnsToTest.length, 0);
// We need to keep the event loop open for this to actually work
// since destroy hooks are triggered in unrefed Immediates
setImmediate(() => {
hook.disable();
assert.strictEqual(fnsToTest.length, 0);
});
});
});
}];
Expand Down