-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunner.ts
50 lines (45 loc) · 1.49 KB
/
runner.ts
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* SPDX-FileCopyrightText: Copyright 2023 Roland Csaszar
* SPDX-License-Identifier: MIT
*
* Project: vscode-scheme-repl
* File: runner.ts
* Date: 14.May.2023
*
* ==============================================================================
* The VS Code test runner, to run tests needing the `vscode` module.
*/
import { runTests } from "@vscode/test-electron";
import path = require("path");
import { vscodeVersion } from "../src/constants";
/**
* The main entry point of the test runner.
*/
async function main() {
try {
// eslint-disable-next-line lines-around-comment
/*
* The folder containing the Extension Manifest package.json
* Passed to `--extensionDevelopmentPath` and used as folder argument,
* to load the current workspace as workspace.
*/
const extensionDevelopmentPath = path.resolve(__dirname, "../../");
/*
* The path to the extension test script
* Passed to --extensionTestsPath
*/
const extensionTestsPath = path.resolve(__dirname, "./main");
// Download VS Code, unzip it and run the integration test
await runTests({
extensionDevelopmentPath,
extensionTestsPath,
version: vscodeVersion,
launchArgs: [extensionDevelopmentPath],
});
} catch (err) {
console.error("Failed to run tests");
// eslint-disable-next-line no-magic-numbers
process.exit(1);
}
}
main();