@@ -4,116 +4,111 @@ import * as cp from 'child_process';
4
4
import { runTests , downloadAndUnzipVSCode , resolveCliArgsFromVSCodeExecutablePath } from '../../..' ;
5
5
6
6
async function go ( ) {
7
- try {
8
- const extensionDevelopmentPath = path . resolve ( __dirname , '../../../' ) ;
9
- const extensionTestsPath = path . resolve ( __dirname , './suite' ) ;
7
+ const extensionDevelopmentPath = path . resolve ( __dirname , '../../../' ) ;
8
+ const extensionTestsPath = path . resolve ( __dirname , './suite' ) ;
10
9
11
- /**
12
- * Basic usage
13
- */
14
- await runTests ( {
15
- extensionDevelopmentPath,
16
- extensionTestsPath
17
- } ) ;
10
+ /**
11
+ * Basic usage
12
+ */
13
+ await runTests ( {
14
+ extensionDevelopmentPath,
15
+ extensionTestsPath,
16
+ } ) ;
18
17
19
- const extensionTestsPath2 = path . resolve ( __dirname , './suite2' ) ;
20
- const testWorkspace = path . resolve ( __dirname , '../../src/test-fixtures/fixture1' ) ;
18
+ const extensionTestsPath2 = path . resolve ( __dirname , './suite2' ) ;
19
+ const testWorkspace = path . resolve ( __dirname , '../../src/test-fixtures/fixture1' ) ;
21
20
22
- /**
23
- * Running another test suite on a specific workspace
24
- */
25
- await runTests ( {
26
- extensionDevelopmentPath,
27
- extensionTestsPath : extensionTestsPath2 ,
28
- launchArgs : [ testWorkspace ]
29
- } ) ;
21
+ /**
22
+ * Running another test suite on a specific workspace
23
+ */
24
+ await runTests ( {
25
+ extensionDevelopmentPath,
26
+ extensionTestsPath : extensionTestsPath2 ,
27
+ launchArgs : [ testWorkspace ] ,
28
+ } ) ;
30
29
31
- /**
32
- * Use 1.36.1 release for testing
33
- */
34
- await runTests ( {
35
- version : '1.36.1' ,
36
- extensionDevelopmentPath,
37
- extensionTestsPath,
38
- launchArgs : [ testWorkspace ]
39
- } ) ;
30
+ /**
31
+ * Use 1.36.1 release for testing
32
+ */
33
+ await runTests ( {
34
+ version : '1.36.1' ,
35
+ extensionDevelopmentPath,
36
+ extensionTestsPath,
37
+ launchArgs : [ testWorkspace ] ,
38
+ } ) ;
40
39
41
- /**
42
- * Use Insiders release for testing
43
- */
44
- await runTests ( {
45
- version : 'insiders' ,
46
- extensionDevelopmentPath,
47
- extensionTestsPath,
48
- launchArgs : [ testWorkspace ]
49
- } ) ;
40
+ /**
41
+ * Use Insiders release for testing
42
+ */
43
+ await runTests ( {
44
+ version : 'insiders' ,
45
+ extensionDevelopmentPath,
46
+ extensionTestsPath,
47
+ launchArgs : [ testWorkspace ] ,
48
+ } ) ;
50
49
51
- /**
52
- * Use a specific Insiders commit for testing
53
- */
54
- await runTests ( {
55
- version : '9d3fbb3d9a50055be0a8c6d721625d02c9de492d' ,
56
- extensionDevelopmentPath,
57
- extensionTestsPath,
58
- launchArgs : [ testWorkspace ]
59
- } ) ;
50
+ /**
51
+ * Use a specific Insiders commit for testing
52
+ */
53
+ await runTests ( {
54
+ version : '9d3fbb3d9a50055be0a8c6d721625d02c9de492d' ,
55
+ extensionDevelopmentPath,
56
+ extensionTestsPath,
57
+ launchArgs : [ testWorkspace ] ,
58
+ } ) ;
60
59
61
- /**
62
- * Noop, since 1.36.1 already downloaded to .vscode-test/vscode-1.36.1
63
- */
64
- await downloadAndUnzipVSCode ( '1.36.1' ) ;
60
+ /**
61
+ * Noop, since 1.36.1 already downloaded to .vscode-test/vscode-1.36.1
62
+ */
63
+ await downloadAndUnzipVSCode ( '1.36.1' ) ;
65
64
66
- /**
67
- * Manually download VS Code 1.35.0 release for testing.
68
- */
69
- const vscodeExecutablePath = await downloadAndUnzipVSCode ( '1.35.0' ) ;
70
- await runTests ( {
71
- vscodeExecutablePath,
72
- extensionDevelopmentPath,
73
- extensionTestsPath,
74
- launchArgs : [ testWorkspace ]
75
- } ) ;
65
+ /**
66
+ * Manually download VS Code 1.35.0 release for testing.
67
+ */
68
+ const vscodeExecutablePath = await downloadAndUnzipVSCode ( '1.35.0' ) ;
69
+ await runTests ( {
70
+ vscodeExecutablePath,
71
+ extensionDevelopmentPath,
72
+ extensionTestsPath,
73
+ launchArgs : [ testWorkspace ] ,
74
+ } ) ;
76
75
77
- /**
78
- * Install Python extension
79
- */
80
- const [ cli , ...args ] = resolveCliArgsFromVSCodeExecutablePath ( vscodeExecutablePath ) ;
81
- cp . spawnSync ( cli , [ ...args , '--install-extension' , 'ms-python.python' ] , {
82
- encoding : 'utf-8' ,
83
- stdio : 'inherit'
84
- } ) ;
76
+ /**
77
+ * Install Python extension
78
+ */
79
+ const [ cli , ...args ] = resolveCliArgsFromVSCodeExecutablePath ( vscodeExecutablePath ) ;
80
+ cp . spawnSync ( cli , [ ...args , '--install-extension' , 'ms-python.python' ] , {
81
+ encoding : 'utf-8' ,
82
+ stdio : 'inherit' ,
83
+ } ) ;
84
+
85
+ /**
86
+ * - Add additional launch flags for VS Code
87
+ * - Pass custom environment variables to test runner
88
+ */
89
+ await runTests ( {
90
+ vscodeExecutablePath,
91
+ extensionDevelopmentPath,
92
+ extensionTestsPath,
93
+ launchArgs : [
94
+ testWorkspace ,
95
+ // This disables all extensions except the one being testing
96
+ '--disable-extensions' ,
97
+ ] ,
98
+ // Custom environment variables for extension test script
99
+ extensionTestsEnv : { foo : 'bar' } ,
100
+ } ) ;
85
101
86
- /**
87
- * - Add additional launch flags for VS Code
88
- * - Pass custom environment variables to test runner
89
- */
102
+ /**
103
+ * Use win64 instead of win32 for testing Windows
104
+ */
105
+ if ( process . platform === 'win32' ) {
90
106
await runTests ( {
91
- vscodeExecutablePath,
92
107
extensionDevelopmentPath,
93
108
extensionTestsPath,
94
- launchArgs : [
95
- testWorkspace ,
96
- // This disables all extensions except the one being testing
97
- '--disable-extensions'
98
- ] ,
99
- // Custom environment variables for extension test script
100
- extensionTestsEnv : { foo : 'bar' }
109
+ version : '1.40.0' ,
110
+ platform : 'win32-x64-archive' ,
101
111
} ) ;
102
-
103
- /**
104
- * Use win64 instead of win32 for testing Windows
105
- */
106
- if ( process . platform === 'win32' ) {
107
- await runTests ( {
108
- extensionDevelopmentPath,
109
- extensionTestsPath,
110
- version : '1.40.0' ,
111
- platform : 'win32-x64-archive'
112
- } ) ;
113
- }
114
- } catch ( err ) {
115
- console . error ( 'Failed to run tests' ) ;
116
- process . exit ( 1 ) ;
117
112
}
118
113
}
119
114
0 commit comments