node/test/parallel/test-diagnostics-channel-gc-maintains-subcriptions.js
Antoine du Hamel f1f6f3df84
test: ensure assertions are reached on more tests
PR-URL: https://github.com/nodejs/node/pull/60641
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-11-11 09:56:18 +00:00

21 lines
434 B
JavaScript

// Flags: --expose-gc
'use strict';
const common = require('../common');
const assert = require('assert');
const { channel } = require('diagnostics_channel');
function test() {
function subscribe() {
channel('test-gc').subscribe(function noop() {});
}
subscribe();
setTimeout(common.mustCall(() => {
global.gc();
assert.ok(channel('test-gc').hasSubscribers, 'Channel must have subscribers');
}));
}
test();