import * as vscode from 'vscode' ; import { TestExecutionInfo , TestFileInfo , TestInfoKind , TestType } from '../types' ; import { testWatcher } from '../testRunner/testWatcher' ; import { isLwcJestTest } from '../utils' ; param data export async function forceLwcTestStartWatching ( data ) { const { testExecutionInfo } = data ; await testWatcher . watchTest ( testExecutionInfo ) ; } param data export async function forceLwcTestStopWatching ( data ) { const { testExecutionInfo } = data ; testWatcher . stopWatchingTest ( testExecutionInfo ) ; } /**
 * Stop watching all tests.
 * It will terminate all test watch tasks.
 */ export function forceLwcTestStopWatchingAllTests ( ) { testWatcher . stopWatchingAllTests ( ) ; } /**
 * Start watching the test of currently focused editor
 */ export async function forceLwcTestStartWatchingCurrentFile ( ) { const { activeTextEditor } = vscode . window ; if ( activeTextEditor && isLwcJestTest ( activeTextEditor . document ) ) { const testExecutionInfo = { kind : TestInfoKind . TEST_FILE , testType : TestType . LWC , testUri : activeTextEditor . document . uri } ; return forceLwcTestStartWatching ( { testExecutionInfo } ) ; } } /**
 * Stop watching the test of currently focused editor
 */ export function forceLwcTestStopWatchingCurrentFile ( ) { const { activeTextEditor } = vscode . window ; if ( activeTextEditor && isLwcJestTest ( activeTextEditor . document ) ) { const testExecutionInfo = { kind : TestInfoKind . TEST_FILE , testType : TestType . LWC , testUri : activeTextEditor . document . uri } ; return forceLwcTestStopWatching ( { testExecutionInfo } ) ; } }