0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-24 12:10:08 +01:00
nodejs/test/parallel/test-diagnostics-channel-has-subscribers.js
ZiJian Liu 2d40e3fc4c lib: fix diagnostics_channel hasSubscribers error
Fixes: https://github.com/nodejs/node/issues/36598

PR-URL: https://github.com/nodejs/node/pull/36599
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-24 07:11:01 -08:00

11 lines
263 B
JavaScript

'use strict';
require('../common');
const assert = require('assert');
const { channel, hasSubscribers } = require('diagnostics_channel');
const dc = channel('test');
assert.ok(!hasSubscribers('test'));
dc.subscribe(() => {});
assert.ok(hasSubscribers('test'));