mirror of
https://github.com/nodejs/node.git
synced 2025-05-01 17:03:34 +00:00

PR-URL: https://github.com/nodejs/node/pull/31569 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
16 lines
400 B
JavaScript
16 lines
400 B
JavaScript
'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());
|