Skip to content

Commit 1a0223d

Browse files
committed
fix node tests
1 parent a0f3144 commit 1a0223d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/unit/node/index.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,22 @@ if (majorRequiredNodeVersion !== currentMajorNodeVersion) {
5656
}
5757

5858
function main() {
59+
60+
// VSCODE_GLOBALS: node_modules
61+
globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), {
62+
get(target, mod) {
63+
if (!target[mod] && typeof mod === 'string') {
64+
target[mod] = require(mod);
65+
}
66+
return target[mod];
67+
}
68+
});
69+
70+
// VSCODE_GLOBALS: package/product.json
71+
globalThis._VSCODE_PRODUCT_JSON = require(`${REPO_ROOT}/product.json`);
72+
globalThis._VSCODE_PACKAGE_JSON = require(`${REPO_ROOT}/package.json`);
73+
74+
5975
process.on('uncaughtException', function (e) {
6076
console.error(e.stack || e);
6177
});

0 commit comments

Comments
 (0)