-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vscode-test.mjs
More file actions
27 lines (23 loc) · 961 Bytes
/
Copy path.vscode-test.mjs
File metadata and controls
27 lines (23 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { defineConfig } from "@vscode/test-cli";
import * as fs from "fs/promises";
import * as path from "path";
import * as os from "os";
import simpleGit from "simple-git";
const fixturePath = path.join(os.tmpdir(), "gops-integration-test-workspace");
/** Initialise a minimal git repo so `GitService` (extension activate) finds a workspace. */
async function prepareWorkspace() {
await fs.rm(fixturePath, { recursive: true, force: true }).catch(() => {});
await fs.mkdir(fixturePath, { recursive: true });
const git = simpleGit(fixturePath);
await git.init();
await git.addConfig("user.email", "test@example.com");
await git.addConfig("user.name", "Test User");
await fs.writeFile(path.join(fixturePath, "README.md"), "# Test\n");
await git.add("README.md");
await git.commit("Initial commit");
}
await prepareWorkspace();
export default defineConfig({
files: "out/test/integration/**/*.test.js",
workspaceFolder: fixturePath,
});