import * as vscode from 'vscode' ; import { nls } from '../../messages' ; import { telemetryService } from '../../telemetry' ; param testUri export function getTestWorkspaceFolder ( testUri ? ) { let workspaceFolder ; if ( testUri ) { workspaceFolder = vscode . workspace . getWorkspaceFolder ( testUri ) ; } else { workspaceFolder = vscode . workspace . workspaceFolders ! [ 0 ] ; } if ( workspaceFolder ) { return workspaceFolder ; } else { const errorMessage = nls . localize ( 'no_workspace_folder_found_for_test_text' ) ; console . error ( errorMessage ) ; vscode . window . showErrorMessage ( errorMessage ) ; telemetryService . sendException ( 'lwc_test_no_workspace_folder_found_for_test' , errorMessage ) ; } }