@@ -24,6 +24,12 @@ const dataDir = process.env["VSCODE_DATA_DIR"];
2424// "env" in launch.json doesn't seem to work with vscode-test
2525const isDebugRun = ! ( process . env [ "_" ] ?? "" ) . endsWith ( "node_modules/.bin/vscode-test" ) ;
2626
27+ function log ( ...args ) {
28+ if ( ! isDebugRun ) {
29+ console . log ( ...args ) ;
30+ }
31+ }
32+
2733// so tests don't timeout when a breakpoint is hit
2834const timeout = isDebugRun ? Number . MAX_SAFE_INTEGER : 3000 ;
2935
@@ -55,24 +61,24 @@ if (vsixPath) {
5561 if ( ! path . isAbsolute ( vsixPath ) ) {
5662 vsixPath = path . join ( __dirname , vsixPath ) ;
5763 }
58- console . log ( "Installing VSIX " + vsixPath ) ;
64+ log ( "Installing VSIX " + vsixPath ) ;
5965 installExtensions . push ( vsixPath ) ;
6066
6167 // Determine version to use
6268 const match = / s w i f t - v s c o d e - ( \d + .\d + .\d + ( - d e v ) ? ) ( - \d + ) ? .v s i x / g. exec ( path . basename ( vsixPath ) ) ;
6369 if ( match ) {
6470 versionStr = match [ 1 ] ;
6571 }
66- console . log ( "Running tests against extension version " + versionStr ) ;
72+ log ( "Running tests against extension version " + versionStr ) ;
6773
6874 extensionDevelopmentPath = `${ __dirname } /.vscode-test/extensions/${ publisher } .${ name } -${ versionStr } ` ;
69- console . log ( "Running tests against extension development path " + extensionDevelopmentPath ) ;
75+ log ( "Running tests against extension development path " + extensionDevelopmentPath ) ;
7076} else {
7177 extensionDependencies . push ( "vadimcn.vscode-lldb" , "llvm-vs-code-extensions.lldb-dap" ) ;
7278}
7379
7480const vscodeVersion = process . env [ "VSCODE_VERSION" ] ?? "stable" ;
75- console . log ( "Running tests against VS Code version " + vscodeVersion ) ;
81+ log ( "Running tests against VS Code version " + vscodeVersion ) ;
7682
7783const installConfigs = [ ] ;
7884for ( const ext of installExtensions ) {
@@ -91,7 +97,7 @@ const env = {
9197 ...process . env ,
9298 RUNNING_UNDER_VSCODE_TEST_CLI : "1" ,
9399} ;
94- console . log ( "Running tests against environment:\n" + JSON . stringify ( env , undefined , 2 ) ) ;
100+ log ( "Running tests against environment:\n" + JSON . stringify ( env , undefined , 2 ) ) ;
95101
96102module . exports = defineConfig ( {
97103 tests : [
0 commit comments