Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Enable Mocha Test Explorer Integration #4518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 14, 2023
Merged
Prev Previous commit
Next Next commit
Better logging
  • Loading branch information
JustinGrote committed Apr 14, 2023
commit 2dfdfcb15d76562d4bd27f2aa6f8cf706ceff02f
8 changes: 5 additions & 3 deletions test/runTestsInner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ import path from "path";
import Mocha from "mocha";
/** This is the entrypoint into the standalone vscode instance that should be passed to the --extensionsTestPath parameter of the test VSCode instance. */
export function run(testsRoot: string): Promise<void> {
console.log(`\n\n=====\nTest Runner Start\n${testsRoot}\n=====`);
return runTestsInner();
return runTestsInner(testsRoot);
}

/** Runs inside of the test vscode instance, and should set up and activate the test runner */
function runTestsInner(): Promise<void> {
function runTestsInner(testsRoot: string): Promise<void> {
// Allow tools like Mocha Test Explorer to inject their own Mocha worker
if (process.env.MOCHA_WORKER_PATH) {
return require(process.env.MOCHA_WORKER_PATH);
}

console.log(`\n\n=====\nTest Runner START\n${testsRoot}\n=====`);

/** Passed from RunTests */
const rootDir = process.env.__TEST_EXTENSION_DEVELOPMENT_PATH;
if (!rootDir) {
Expand Down Expand Up @@ -59,6 +60,7 @@ function runTestsInner(): Promise<void> {
if (failures > 0) {
throw new Error(`${failures} tests failed.`);
} else {
console.log("\n\n=====\nTest Runner STOP\n=====");
return c();
}
});
Expand Down