Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
},
"devDependencies": {
"@types/chai": "4.2.14",
"@types/mocha": "8.2.0",
"@types/node": "14.14.19",
"@types/mocha": "^10.0.0",
"@types/node": "^20.0.0",
"eslint": "7.27.0",
"eslint-config-prettier": "7.2.0",
"eslint-plugin-eslint-comments": "3.2.0",
Expand All @@ -41,11 +41,11 @@
"husky": "4.3.8",
"lerna": "4.0.0",
"lint-staged": "11.0.0",
"mocha": "7.2.0",
"mocha": "^10.4.0",
"npm-run-all": "4.1.5",
"nyc": "15.1.0",
"nyc": "^17.0.0",
"prettier": "2.2.1",
"typescript": "4.1.3",
"typescript": "^5.0.0",
"cz-conventional-changelog": "3.3.0",
"@commitlint/cli": "11.0.0",
"@commitlint/config-conventional": "11.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/xml-toolkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"lodash": "4.17.23",
"proxyquire": "2.1.3",
"vsce": "1.84.0",
"vscode-test": "1.5.2"
"@vscode/test-electron": "^2.4.0"
},
"nyc": {
"include": [
Expand Down
14 changes: 12 additions & 2 deletions packages/xml-toolkit/test/runTest.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
const { resolve } = require("path");
const { runTests } = require("vscode-test");
const { runTests } = require("@vscode/test-electron");

async function main() {
try {
// NODE_OPTIONS set by nyc for coverage instrumentation are not supported
// in Electron/VS Code packaged apps and cause the test runner to fail.
// Clear them before launching VS Code to avoid this issue.
delete process.env.NODE_OPTIONS;

// The path to the extension test environment
// Passed to --extensionTestsEnv
const extensionTestsEnv = {
Expand All @@ -22,9 +27,14 @@ async function main() {
extensionTestsEnv,
extensionDevelopmentPath,
extensionTestsPath,
// Required for headless CI environments (Jenkins, etc.) where no
// display server is available. Without these flags Electron refuses
// to start and the test run fails immediately.
launchArgs: ["--headless", "--disable-gpu", "--no-sandbox"],
});
} catch (err) {
console.error("Failed to run tests");
// Log the underlying error so CI logs actually show what went wrong.
console.error("Failed to run tests:", err);
process.exit(1);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/xml-toolkit/test/suite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ function run() {
const mocha = new Mocha({
ui: "bdd",
timeout: 20000,
color: true,
});
mocha.useColors(true);

const testsRoot = resolve(__dirname);

Expand Down
Loading