1- import * as cp from 'child_process' ;
2- import * as path from 'path' ;
1+ import * as cp from "child_process" ;
2+ import * as path from "path" ;
3+
34import {
4- downloadAndUnzipVSCode ,
5- resolveCliArgsFromVSCodeExecutablePath ,
6- runTests
7- } from ' @vscode/test-electron' ;
5+ downloadAndUnzipVSCode ,
6+ resolveCliArgsFromVSCodeExecutablePath ,
7+ runTests
8+ } from " @vscode/test-electron" ;
89
910async function main ( ) {
1011 try {
11- const extensionDevelopmentPath = path . resolve ( __dirname , '../../../' ) ;
12- const extensionTestsPath = path . resolve ( __dirname , './suite/index' ) ;
13- const vscodeExecutablePath = await downloadAndUnzipVSCode ( ) ;
14- const [ cliPath , ...args ] = resolveCliArgsFromVSCodeExecutablePath ( vscodeExecutablePath ) ;
12+ // The folder containing the Extension Manifest package.json
13+ // Passed to `--extensionDevelopmentPath`
14+ const extensionDevelopmentPath = path . resolve ( __dirname , "../../" ) ;
15+
16+ // The path to the extension test script
17+ // Passed to --extensionTestsPath
18+ const extensionTestsPath = path . resolve ( __dirname , "./suite/index" ) ;
19+ const vscodeExecutablePath = await downloadAndUnzipVSCode ( "stable" ) ;
20+ const [ cli , ...args ] = resolveCliArgsFromVSCodeExecutablePath ( vscodeExecutablePath ) ;
1521
22+ // Install dependent extensions
1623 // Use cp.spawn / cp.exec for custom setup
1724 cp . spawnSync (
18- cliPath ,
25+ cli ,
1926 [ ...args , '--install-extension' , 'intersystems-community.servermanager' , '--install-extension' , 'intersystems-community.vscode-objectscript' ] ,
2027 {
2128 encoding : 'utf-8' ,
22- stdio : 'inherit'
29+ stdio : 'inherit' ,
30+ shell : process . platform === 'win32'
2331 }
2432 ) ;
2533
@@ -30,8 +38,8 @@ async function main() {
3038 extensionDevelopmentPath,
3139 extensionTestsPath
3240 } ) ;
33- } catch ( err ) {
34- console . error ( ' Failed to run tests' ) ;
41+ } catch ( err ) {
42+ console . error ( " Failed to run tests" , err ) ;
3543 process . exit ( 1 ) ;
3644 }
3745}
0 commit comments