@@ -4,43 +4,40 @@ import * as fs from 'fs';
44import { runTests } from 'vscode-test' ;
55
66async function main ( ) {
7- try {
8- // The folder containing the Extension Manifest package.json
9- // Passed to `--extensionDevelopmentPath`
10- const extensionDevelopmentPath = path . resolve ( __dirname , '../../' ) ;
11-
12- // Minimum supported version.
13- const jsonData = fs . readFileSync ( path . join ( extensionDevelopmentPath , 'package.json' ) ) ;
14- const json = JSON . parse ( jsonData . toString ( ) ) ;
15- let minimalVersion : string = json . engines . vscode ;
16- if ( minimalVersion . startsWith ( '^' ) ) minimalVersion = minimalVersion . slice ( 1 ) ;
17-
18- const launchArgs = [ "--disable-extensions" ] ;
19-
20- // All test suites (either unit tests or integration tests) should be in subfolders.
21- const extensionTestsPath = path . resolve ( __dirname , './unit/index' ) ;
22-
23- // Run tests using the minimal supported version.
24- await runTests ( {
25- version : minimalVersion ,
26- launchArgs,
27- extensionDevelopmentPath,
28- extensionTestsPath
29- } ) ;
30-
31- // and the latest one
32- await runTests ( {
33- version : 'stable' ,
34- launchArgs,
35- extensionDevelopmentPath,
36- extensionTestsPath
37- } ) ;
38-
39- } catch ( err ) {
40- // eslint-disable-next-line no-console
41- console . error ( 'Failed to run tests' , err ) ;
42- process . exit ( 1 ) ;
43- }
7+ // The folder containing the Extension Manifest package.json
8+ // Passed to `--extensionDevelopmentPath`
9+ const extensionDevelopmentPath = path . resolve ( __dirname , '../../' ) ;
10+
11+ // Minimum supported version.
12+ const jsonData = fs . readFileSync ( path . join ( extensionDevelopmentPath , 'package.json' ) ) ;
13+ const json = JSON . parse ( jsonData . toString ( ) ) ;
14+ let minimalVersion : string = json . engines . vscode ;
15+ if ( minimalVersion . startsWith ( '^' ) ) minimalVersion = minimalVersion . slice ( 1 ) ;
16+
17+ const launchArgs = [ "--disable-extensions" ] ;
18+
19+ // All test suites (either unit tests or integration tests) should be in subfolders.
20+ const extensionTestsPath = path . resolve ( __dirname , './unit/index' ) ;
21+
22+ // Run tests using the minimal supported version.
23+ await runTests ( {
24+ version : minimalVersion ,
25+ launchArgs,
26+ extensionDevelopmentPath,
27+ extensionTestsPath
28+ } ) ;
29+
30+ // and the latest one
31+ await runTests ( {
32+ version : 'stable' ,
33+ launchArgs,
34+ extensionDevelopmentPath,
35+ extensionTestsPath
36+ } ) ;
4437}
4538
46- main ( ) ;
39+ main ( ) . catch ( err => {
40+ // eslint-disable-next-line no-console
41+ console . error ( 'Failed to run tests' , err ) ;
42+ process . exit ( 1 ) ;
43+ } ) ;
0 commit comments