fix node tests

This commit is contained in:
Johannes 2022-11-17 17:19:29 +01:00
parent a0f314404e
commit 1a0223da3f
No known key found for this signature in database
GPG Key ID: 6DEF802A22264FCA

View File

@ -56,6 +56,22 @@ if (majorRequiredNodeVersion !== currentMajorNodeVersion) {
}
function main() {
// VSCODE_GLOBALS: node_modules
globalThis._VSCODE_NODE_MODULES = new Proxy(Object.create(null), {
get(target, mod) {
if (!target[mod] && typeof mod === 'string') {
target[mod] = require(mod);
}
return target[mod];
}
});
// VSCODE_GLOBALS: package/product.json
globalThis._VSCODE_PRODUCT_JSON = require(`${REPO_ROOT}/product.json`);
globalThis._VSCODE_PACKAGE_JSON = require(`${REPO_ROOT}/package.json`);
process.on('uncaughtException', function (e) {
console.error(e.stack || e);
});