-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelectron-runner.mjs
More file actions
35 lines (30 loc) · 967 Bytes
/
electron-runner.mjs
File metadata and controls
35 lines (30 loc) · 967 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
28
29
30
31
32
33
34
35
import * as path from 'path';
import {
downloadAndUnzipVSCode,
runTests
} from '@vscode/test-electron';
import { fileURLToPath } from 'url';
import { dirname } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
async function main() {
try {
const extensionDevelopmentPath = path.resolve(__dirname);
// const extensionTestsPath = path.resolve(__dirname, './jest-e2e-runner.js');
const extensionTestsPath = path.resolve(__dirname, './out/test/suite/jest-runner.js');
const vscodeExecutablePath = await downloadAndUnzipVSCode('insiders');
// Run the extension test
await runTests({
// Use the specified `code` executable
vscodeExecutablePath,
extensionDevelopmentPath,
extensionTestsPath,
launchArgs: ['--disable-extensions'],
});
} catch (err) {
console.error(err);
console.error('Failed to run tests');
process.exit(1);
}
}
main();