Skip to content

Commit 2bf91c0

Browse files
committed
test: fix status when compiled without inspector
1 parent e2b33a3 commit 2bf91c0

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

test/common/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const noop = () => {};
5454
const hasCrypto = Boolean(process.versions.openssl) &&
5555
!process.env.NODE_SKIP_CRYPTO;
5656

57+
const hasInspector = Boolean(process.features.inspector);
5758
const hasSQLite = Boolean(process.versions.sqlite);
5859

5960
const hasQuic = hasCrypto && !!process.features.quic;
@@ -711,7 +712,7 @@ function expectsError(validator, exact) {
711712
}
712713

713714
function skipIfInspectorDisabled() {
714-
if (!process.features.inspector) {
715+
if (!hasInspector) {
715716
skip('V8 inspector is disabled');
716717
}
717718
}
@@ -930,6 +931,7 @@ const common = {
930931
hasIntl,
931932
hasCrypto,
932933
hasQuic,
934+
hasInspector,
933935
hasSQLite,
934936
invalidArgTypeHelper,
935937
isAlive,

test/parallel/test-process-get-builtin.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { hasCrypto, hasIntl, hasSQLite } from '../common/index.mjs';
22
import assert from 'node:assert';
33
import { builtinModules } from 'node:module';
44
import { isMainThread } from 'node:worker_threads';
5+
import { hasInspector } from '../common';
56

67
for (const invalid of [1, undefined, null, false, [], {}, () => {}, Symbol('test')]) {
78
assert.throws(() => process.getBuiltinModule(invalid), { code: 'ERR_INVALID_ARG_TYPE' });
@@ -39,6 +40,10 @@ if (!hasIntl) {
3940
// TODO(@jasnell): Remove this once node:quic graduates from unflagged.
4041
publicBuiltins.delete('node:quic');
4142

43+
if (!hasInspector) {
44+
publicBuiltins.delete('inspector');
45+
publicBuiltins.delete('inspector/promises');
46+
}
4247
if (!hasSQLite) {
4348
publicBuiltins.delete('node:sqlite');
4449
}

test/wpt/status/console.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"idlharness.any.js": {
33
"note": "https://github.com/nodejs/node/issues/44185",
4-
"requires": ["crypto", "small-icu"]
4+
"requires": ["crypto", "inspector", "small-icu"]
55
},
66
"idlharness-shadowrealm.window.js": {
77
"skip": "ShadowRealm support is not enabled"

0 commit comments

Comments
 (0)