MCPcopy Index your code
hub / github.com/nodejs/node / test

Function test

test/parallel/test-diagnostics-channel-gc-maintains-subcriptions.js:8–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6const { channel } = require('diagnostics_channel');
7
8function test() {
9 function subscribe() {
10 channel('test-gc').subscribe(function noop() {});
11 }
12
13 subscribe();
14
15 setTimeout(common.mustCall(() => {
16 global.gc();
17 assert.ok(channel('test-gc').hasSubscribers, 'Channel must have subscribers');
18 }));
19}
20
21test();

Calls 4

channelFunction · 0.85
subscribeFunction · 0.70
setTimeoutFunction · 0.50
okMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…