blob: 06e260374cd3a469e4df3111a16d27221f7a7640 [file] [log] [blame] [edit]
'use strict';
const common = require('../common');
const assert = require('assert');
const { Worker } = require('worker_threads');
const { once } = require('events');
(async function() {
const w = new Worker('', { eval: true });
await once(w, 'exit');
await assert.rejects(() => w.getHeapSnapshot(), {
name: 'Error',
code: 'ERR_WORKER_NOT_RUNNING'
});
})().then(common.mustCall());