Skip to content

Commit 6972aeb

Browse files
committed
squash: skip inspector if not present
1 parent 3607f2f commit 6972aeb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/parallel/test-module-property-accessors.mjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ function isValid({ key, moduleName, path, propName, value, obj, fullPath }) {
2727
return true;
2828
}
2929

30+
function shouldSkipModule(moduleName) {
31+
switch (moduleName) {
32+
case 'inspector':
33+
case 'inspector/promises':
34+
if (!process.features.inspector) {
35+
return true;
36+
}
37+
break;
38+
}
39+
return false;
40+
}
41+
3042
async function buildList(obj, moduleName, path = [], visited = new WeakMap()) {
3143
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) return [];
3244

@@ -86,6 +98,9 @@ async function buildList(obj, moduleName, path = [], visited = new WeakMap()) {
8698
let total = 0;
8799

88100
await Promise.all(builtinModules.map(async (moduleName) => {
101+
if (shouldSkipModule(moduleName)) {
102+
return;
103+
}
89104
const module = await import(moduleName);
90105
const { length } = await buildList(module, moduleName);
91106
total += length;

0 commit comments

Comments
 (0)