fix node tests

This commit is contained in:
Johannes 2022-11-17 17:19:29 +01:00
parent 380ac1ef48
commit 824c70b275
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);
});