Skip to content
Merged
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
6 changes: 3 additions & 3 deletions extensions/ql-vscode/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ module.exports = {
projects: [
"<rootDir>/src/view",
"<rootDir>/test",
"<rootDir>/out/vscode-tests/cli-integration",
"<rootDir>/out/vscode-tests/no-workspace",
"<rootDir>/out/vscode-tests/minimal-workspace",
"<rootDir>/src/vscode-tests/cli-integration",
"<rootDir>/src/vscode-tests/no-workspace",
"<rootDir>/src/vscode-tests/minimal-workspace",
],
};
6 changes: 3 additions & 3 deletions extensions/ql-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1273,9 +1273,9 @@
"test:unit": "jest --projects test",
"test:view": "jest --projects src/view",
"integration": "npm-run-all integration:*",
"integration:no-workspace": "jest --projects out/vscode-tests/no-workspace",
"integration:minimal-workspace": "jest --projects out/vscode-tests/minimal-workspace",
"cli-integration": "jest --projects out/vscode-tests/cli-integration",
"integration:no-workspace": "jest --projects src/vscode-tests/no-workspace",
"integration:minimal-workspace": "jest --projects src/vscode-tests/minimal-workspace",
"cli-integration": "jest --projects src/vscode-tests/cli-integration",
"update-vscode": "node ./node_modules/vscode/bin/install",
"format": "prettier --write **/*.{ts,tsx} && eslint . --ext .ts,.tsx --fix",
"lint": "eslint . --ext .ts,.tsx --max-warnings=0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import * as path from "path";
const path = require("path");

import { RunnerOptions } from "jest-runner-vscode";
const {
config: baseConfig,
rootDir,
} = require("../jest-runner-vscode.config.base");

import baseConfig, { rootDir } from "../jest-runner-vscode.config.base";

const config: RunnerOptions = {
/** @type import("jest-runner-vscode").RunnerOptions */
const config = {
...baseConfig,
launchArgs: [
...(baseConfig.launchArgs ?? []),
Expand All @@ -25,6 +27,4 @@ const config: RunnerOptions = {
},
};

// We are purposefully not using export default here since that would result in an ESModule, which doesn't seem to be
// supported properly by jest-runner-vscode (cosmiconfig doesn't really seem to support it).
module.exports = config;
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import baseConfig from "../jest.config.base";

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

export default config;
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const queryTestCases: QueryTestCase[] = [
];

const db: messages.Dataset = {
dbDir: path.join(__dirname, "../test-db"),
dbDir: path.join(__dirname, "../../../.vscode-test/test-db"),
workingSet: "default",
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as path from "path";
import * as tmp from "tmp-promise";
import { RunnerOptions } from "jest-runner-vscode";
const path = require("path");
const tmp = require("tmp-promise");

export const tmpDir = tmp.dirSync({ unsafeCleanup: true });
const tmpDir = tmp.dirSync({ unsafeCleanup: true });

export const rootDir = path.resolve(__dirname, "../..");
const rootDir = path.resolve(__dirname, "../..");

const config: RunnerOptions = {
/** @type import("jest-runner-vscode").RunnerOptions */
const config = {
version: "stable",
launchArgs: [
"--disable-gpu",
Expand All @@ -20,4 +20,8 @@ if (process.env.VSCODE_INSPECTOR_OPTIONS) {
config.launchArgs?.push("--inspect-extensions", "9223");
}

export default config;
module.exports = {
config,
tmpDir,
rootDir,
};
4 changes: 2 additions & 2 deletions extensions/ql-vscode/src/vscode-tests/jest.config.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const config: Config = {
// notifyMode: "failure-change",

// A preset that is used as a base for Jest's configuration
// preset: 'ts-jest',
preset: "ts-jest",

// Run tests from one or more projects
// projects: undefined,
Expand Down Expand Up @@ -128,7 +128,7 @@ const config: Config = {
// setupFiles: [],

// A list of paths to modules that run some code to configure or set up the testing framework before each test
setupFilesAfterEnv: ["<rootDir>/../jest.setup.js"],
setupFilesAfterEnv: ["<rootDir>/../jest.setup.ts"],

// The number of seconds after which a test is considered as slow and reported as such in the results.
// slowTestThreshold: 5,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const path = require("path");

const {
config: baseConfig,
rootDir,
} = require("../jest-runner-vscode.config.base");

/** @type import("jest-runner-vscode").RunnerOptions */
const config = {
...baseConfig,
launchArgs: [
...(baseConfig.launchArgs ?? []),
"--disable-extensions",
path.resolve(rootDir, "test/data"),
],
};

module.exports = config;

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { config: baseConfig } = require("../jest-runner-vscode.config.base");

/** @type import("jest-runner-vscode").RunnerOptions */
const config = {
...baseConfig,
launchArgs: [...(baseConfig.launchArgs ?? []), "--disable-extensions"],
};

module.exports = config;

This file was deleted.