-
Notifications
You must be signed in to change notification settings - Fork 6
/
run-e2e-tests.js
38 lines (32 loc) · 1.17 KB
/
run-e2e-tests.js
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
// @ts-check
const path = require('path');
const { runTests } = require('@vscode/test-electron');
async function runSuite(suiteName) {
try {
// The folder containing the Extension Manifest package.json
// Passed to `--extensionDevelopmentPath`
const extensionDevelopmentPath = __dirname;
// The path to the extension test script
// Passed to --extensionTestsPath
const extensionTestsPath = path.join(__dirname, `./dist/test/e2e/${suiteName}/index`);
// path to the test fixtures (root directory of test contexts)
const pathToOpen = path.join(extensionDevelopmentPath, 'fixtures', suiteName);
// Download VS Code, unzip it and run the integration test
await runTests({
extensionDevelopmentPath,
extensionTestsPath,
launchArgs: [pathToOpen],
});
} catch (err) {
console.error('Failed to run tests');
console.error(err);
process.exit(1);
}
}
async function runAllSuites() {
await runSuite('latest');
await runSuite('v5-with-no-config');
await runSuite('v5-with-config');
await runSuite('config-errors');
}
runAllSuites();