import * as path from 'path' ; import { runTests } from '@vscode/test-electron' ; import { TestOptions } from '@vscode/test-electron/out/runTest' ; import { exec } from '../utils' ; async function terraformInit ( ) { const cwd = process . cwd ( ) ; process . chdir ( 'testFixture' ) ; const { stdout } = await exec ( 'terraform' , [ 'init' , '-no-color' ] ) ; console . log ( stdout ) ; process . chdir ( cwd ) ; } async function main ( ) { try { await terraformInit ( ) ; } catch ( err ) { console . error ( err ) ; console . error ( 'Failed to run tests' ) ; process . exitCode = 1 ; } const extensionDevelopmentPath = path . resolve ( __dirname , '../../' ) ; const extensionTestsPath = path . resolve ( __dirname , './integration/index' ) ; const options = { version : process . env [ 'VSCODE_VERSION' ] ?? 'stable' , extensionDevelopmentPath , extensionTestsPath , launchArgs : [ 'testFixture' , '--disable-extensions' , '--disable-workspace-trust' ] , } ; try { console . log ( `_______________${ options . version }_____________________` ) ; await runTests ( options ) ; } catch ( err ) { console . error ( err ) ; console . error ( 'Failed to run tests' ) ; process . exitCode = 1 ; } } main ( ) ;