node/test/fixtures/inspector-open.js
Moshe Atlow 7b4cc58b70
inspector: allow opening inspector when NODE_V8_COVERAGE is set
PR-URL: https://github.com/nodejs/node/pull/46113
Fixes: https://github.com/nodejs/node/issues/46110
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-01-29 21:46:36 +00:00

15 lines
385 B
JavaScript

const assert = require('assert');
const inspector = require('inspector');
assert.strictEqual(inspector.url(), undefined);
inspector.open(0, undefined, false);
assert(inspector.url().startsWith('ws://'));
assert.throws(() => {
inspector.open(0, undefined, false);
}, {
code: 'ERR_INSPECTOR_ALREADY_ACTIVATED'
});
inspector.close();
assert.strictEqual(inspector.url(), undefined);