nodejs/test/parallel/test-diagnostics-channel-has-subscribers.js

11 lines
263 B
JavaScript
Raw Permalink Normal View History

'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'));