import * as fse from 'fs-extra' ; import { IHookCallbackContext } from 'mocha' ; import * as os from 'os' ; import * as path from 'path' ; import * as vscode from 'vscode' ; import { TestOutputChannel , TestUserInput } from 'vscode-azureextensiondev' ; import { ext , getRandomHexString , parseError } from '../extension.bundle' ; export let longRunningTestsEnabled ; export const testFolderPath = path . join ( os . tmpdir ( ) , `azureApiManagementTest${ getRandomHexString ( ) }` ) ; suiteSetup ( async function ( this ) : Promise < void > { this . timeout ( 120 * 1000 ) ; await fse . ensureDir ( testFolderPath ) ; ext . outputChannel = new TestOutputChannel ( ) ; ext . ui = new TestUserInput ( vscode ) ; longRunningTestsEnabled = ! /^(false|0)?$/i . test ( process . env . ENABLE_LONG_RUNNING_TESTS || '' ) ; } ) ; suiteTeardown ( async function ( this ) : Promise < void > { this . timeout ( 90 * 1000 ) ; try { await fse . remove ( testFolderPath ) ; } catch ( error ) { console . warn ( `Failed to delete test folder path: ${ parseError ( error ) . message }` ) ; } } ) ;