node/test/parallel/test-diagnostics-channel-worker-threads.js
theanarkh 0633e9a0b5
lib: add diagnostics channel for process and worker
PR-URL: https://github.com/nodejs/node/pull/44045
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-08-30 17:08:33 +00:00

12 lines
344 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
const { Worker } = require('worker_threads');
const dc = require('diagnostics_channel');
dc.subscribe('worker_threads', common.mustCall(({ worker }) => {
assert.strictEqual(worker instanceof Worker, true);
}));
new Worker('const a = 1;', { eval: true });