Skip to content

Commit

Permalink
Merge pull request #3234 from github/koesie10/remove-jest-runner-inst…
Browse files Browse the repository at this point in the history
…alled-extensions

Simplify custom Jest test runner
  • Loading branch information
koesie10 authored Jan 12, 2024
2 parents b67efee + 0534cb7 commit ea1419a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 68 deletions.
2 changes: 1 addition & 1 deletion extensions/ql-vscode/scripts/find-deadcode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function ignoreFile(file: string): boolean {
containsPath(".storybook", file) ||
containsPath(join("src", "stories"), file) ||
pathsEqual(
join("test", "vscode-tests", "jest-runner-installed-extensions.ts"),
join("test", "vscode-tests", "jest-runner-vscode-codeql-cli.ts"),
file,
) ||
basename(file) === "jest.config.ts" ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import baseConfig from "../jest.config.base";

const config: Config = {
...baseConfig,
runner: "<rootDir>/../jest-runner-installed-extensions.ts",
runner: "<rootDir>/../jest-runner-vscode-codeql-cli.ts",
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import baseConfig from "../jest.config.base";

const config: Config = {
...baseConfig,
runner: "<rootDir>/../jest-runner-installed-extensions.ts",
runner: "<rootDir>/../jest-runner-vscode-codeql-cli.ts",
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
// CLI integration tests call into the CLI and execute queries, so these are expected to take a lot longer
// than the default 5 seconds.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type * as JestRunner from "jest-runner";
import VSCodeTestRunner from "jest-runner-vscode";
import { ensureCli } from "./ensureCli";

export default class JestRunnerVscodeCodeqlCli extends VSCodeTestRunner {
async runTests(
tests: JestRunner.Test[],
watcher: JestRunner.TestWatcher,
onStart: JestRunner.OnTestStart,
onResult: JestRunner.OnTestSuccess,
onFailure: JestRunner.OnTestFailure,
): Promise<void> {
// The CLI integration tests require the CLI to be available. We do not want to install the CLI
// when VS Code is already running because this will not give any feedback to the test runner. Instead,
// we'll download the CLI now and pass the path to the CLI to VS Code.
await ensureCli(true);

return super.runTests(tests, watcher, onStart, onResult, onFailure);
}
}

0 comments on commit ea1419a

Please sign in to comment.