Skip to content

Commit 67f2dd8

Browse files
committed
this will definitely work
1 parent d82fc4d commit 67f2dd8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/testing.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import { writeFile } from "fs/promises";
22
import { globSync } from "glob";
33
import Mocha from "mocha";
4-
import { resolve } from "path";
4+
import { join, resolve } from "path";
55

66
export async function run() {
7-
console.log(`process.cwd=${process.cwd()} __dirname=${__dirname}`);
7+
// Unix cwd is ___/vscode, but on Windows it's ___/vscode/.vscode-test/<archive>/
8+
// so we're going off of __dirname which is ___/vscode/out/src for both
9+
const projectRoot = resolve(__dirname, "../..");
10+
const resultFilePath = join(projectRoot, "TEST-result.xml");
11+
console.log(`Writing test results to "${resultFilePath}"`);
812

913
const version = process.env.VSCODE_VERSION ?? "stable";
1014
const mocha = new Mocha({
@@ -16,7 +20,7 @@ export async function run() {
1620
reporterEnabled: "spec, mocha-junit-reporter",
1721
mochaJunitReporterReporterOptions: {
1822
testsuitesTitle: `VS Code (${version}) Extension Tests: Mocha (${process.platform} ${process.arch})`,
19-
mochaFile: resolve(process.cwd(), "TEST-result.xml"),
23+
mochaFile: resultFilePath,
2024
},
2125
},
2226
});

0 commit comments

Comments
 (0)