Skip to content

Commit 4c03a7f

Browse files
committed
test: fix status when compiled without inspector
PR-URL: #60289 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent e992057 commit 4c03a7f

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
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.config.variables.openssl_quic;
@@ -673,7 +674,7 @@ function expectsError(validator, exact) {
673674
}
674675

675676
function skipIfInspectorDisabled() {
676-
if (!process.features.inspector) {
677+
if (!hasInspector) {
677678
skip('V8 inspector is disabled');
678679
}
679680
}
@@ -891,6 +892,7 @@ const common = {
891892
hasIntl,
892893
hasCrypto,
893894
hasQuic,
895+
hasInspector,
894896
hasSQLite,
895897
invalidArgTypeHelper,
896898
isAlive,

test/common/index.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const {
1616
getBufferSources,
1717
getTTYfd,
1818
hasCrypto,
19+
hasInspector,
1920
hasSQLite,
2021
hasIntl,
2122
hasIPv6,
@@ -66,6 +67,7 @@ export {
6667
getPort,
6768
getTTYfd,
6869
hasCrypto,
70+
hasInspector,
6971
hasSQLite,
7072
hasIntl,
7173
hasIPv6,

test/common/wpt.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,9 @@ class BuildRequirement {
399399
// Not using common.hasCrypto because of the global leak checks
400400
this.hasCrypto = Boolean(process.versions.openssl) &&
401401
!process.env.NODE_SKIP_CRYPTO;
402+
403+
// Not using common.hasInspector because of the global leak checks
404+
this.hasInspector = Boolean(process.features.inspector);
402405
}
403406

404407
/**
@@ -416,6 +419,9 @@ class BuildRequirement {
416419
if (requires.has('crypto') && !this.hasCrypto) {
417420
return 'crypto';
418421
}
422+
if (requires.has('inspector') && !this.hasInspector) {
423+
return 'inspector';
424+
}
419425
return false;
420426
}
421427
}

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { hasCrypto, hasIntl, hasSQLite } from '../common/index.mjs';
1+
import { hasCrypto, hasIntl, hasInspector, hasSQLite } from '../common/index.mjs';
22
import assert from 'node:assert';
33
import { builtinModules } from 'node:module';
44
import { isMainThread } from 'node:worker_threads';
@@ -37,6 +37,10 @@ if (!hasIntl) {
3737
publicBuiltins.delete('trace_events');
3838
}
3939

40+
if (!hasInspector) {
41+
publicBuiltins.delete('inspector');
42+
publicBuiltins.delete('inspector/promises');
43+
}
4044
if (!hasSQLite) {
4145
publicBuiltins.delete('node:sqlite');
4246
}

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)