Skip to content

Commit 4b23ac8

Browse files
committed
test: fix status when compiled without inspector
PR-URL: #60289 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ulises Gascón <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
1 parent 17fde3f commit 4b23ac8

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
consthasCrypto=Boolean(process.versions.openssl)&&
5555
!process.env.NODE_SKIP_CRYPTO;
5656

57+
consthasInspector=Boolean(process.features.inspector);
5758
consthasSQLite=Boolean(process.versions.sqlite);
5859

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

713714
functionskipIfInspectorDisabled(){
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/common/index.mjs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const{
1717
getTTYfd,
1818
hasCrypto,
1919
hasQuic,
20+
hasInspector,
2021
hasSQLite,
2122
hasIntl,
2223
hasIPv6,
@@ -68,6 +69,7 @@ export{
6869
getTTYfd,
6970
hasCrypto,
7071
hasQuic,
72+
hasInspector,
7173
hasSQLite,
7274
hasIntl,
7375
hasIPv6,

‎test/common/wpt.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,9 @@ class BuildRequirement{
412412
// Not using common.hasCrypto because of the global leak checks
413413
this.hasCrypto=Boolean(process.versions.openssl)&&
414414
!process.env.NODE_SKIP_CRYPTO;
415+
416+
// Not using common.hasInspector because of the global leak checks
417+
this.hasInspector=Boolean(process.features.inspector);
415418
}
416419

417420
/**
@@ -429,6 +432,9 @@ class BuildRequirement{
429432
if(requires.has('crypto')&&!this.hasCrypto){
430433
return'crypto';
431434
}
435+
if(requires.has('inspector')&&!this.hasInspector){
436+
return'inspector';
437+
}
432438
returnfalse;
433439
}
434440
}

‎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
importassertfrom'node:assert';
33
import{builtinModules}from'node:module';
44
import{isMainThread}from'node:worker_threads';
@@ -39,6 +39,10 @@ if (!hasIntl){
3939
// TODO(@jasnell): Remove this once node:quic graduates from unflagged.
4040
publicBuiltins.delete('node:quic');
4141

42+
if(!hasInspector){
43+
publicBuiltins.delete('inspector');
44+
publicBuiltins.delete('inspector/promises');
45+
}
4246
if(!hasSQLite){
4347
publicBuiltins.delete('node:sqlite');
4448
}

‎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)