diff --git a/test/common/index.js b/test/common/index.js index 1b82d8487287bf..a1388a20a1d53e 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -739,7 +739,7 @@ function invalidArgTypeHelper(input) { return ` Received type ${typeof input} (${inspected})`; } -module.exports = { +const common = { allowGlobals, buildType, canCreateSymLink, @@ -882,3 +882,12 @@ module.exports = { } }; + +const validProperties = new Set(Object.keys(common)); +module.exports = new Proxy(common, { + get(obj, prop) { + if (!validProperties.has(prop)) + throw new Error(`Using invalid common property: '${prop}'`); + return obj[prop]; + } +});