Skip to content

Commit 6d4b700

Browse files
authored
Merge pull request #144 from YoshinoriN/cross-version-test
test: add cross version test
2 parents a8f00b3 + d53d6c6 commit 6d4b700

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

src/test/runTest.ts

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import * as path from 'path';
2-
import { runTests } from 'vscode-test';
2+
import {
3+
runTests,
4+
downloadAndUnzipVSCode
5+
} from 'vscode-test';
36

47
async function main() {
58
const extensionDevelopmentPath = path.resolve(__dirname, '../../');
69
const extensionTestsPath = path.resolve(__dirname, './suite/index');
710

11+
// latest version test
812
try {
913
await runTests({
1014
extensionDevelopmentPath,
@@ -15,6 +19,36 @@ async function main() {
1519
console.error('Failed to run tests');
1620
process.exit(1);
1721
}
22+
setTimeout(() => {}, 3000);
23+
24+
// v1.45.0 test
25+
let vscodeExecutablePath = await downloadAndUnzipVSCode('1.45.0');
26+
try {
27+
await runTests({
28+
vscodeExecutablePath,
29+
extensionDevelopmentPath,
30+
extensionTestsPath,
31+
launchArgs: ['--disable-extensions']
32+
});
33+
} catch (err) {
34+
console.error('Failed to run tests');
35+
process.exit(1);
36+
}
37+
setTimeout(() => {}, 3000);
38+
39+
// legacy version test
40+
vscodeExecutablePath = await downloadAndUnzipVSCode('1.40.0');
41+
try {
42+
await runTests({
43+
vscodeExecutablePath,
44+
extensionDevelopmentPath,
45+
extensionTestsPath,
46+
launchArgs: ['--disable-extensions']
47+
});
48+
} catch (err) {
49+
console.error('Failed to run tests');
50+
process.exit(1);
51+
}
1852
}
1953

2054
main();

0 commit comments

Comments
 (0)