refactor(browser): remove dead CLI test mocks

This commit is contained in:
Vincent Koc
2026-06-18 16:15:04 +08:00
parent 60d6a8a89d
commit e3bd804a17

View File

@@ -43,28 +43,3 @@ export function getBrowserCliRuntimeCapture(): CliRuntimeCapture {
export function getBrowserCliRuntime() {
return getBrowserCliRuntimeCapture().defaultRuntime;
}
/** Provides a mock module shape for defaultRuntime imports. */
export async function mockBrowserCliDefaultRuntime() {
browserCliRuntimeState.capture ??= createCliRuntimeCapture();
return { defaultRuntime: browserCliRuntimeState.capture.defaultRuntime };
}
/** Runs a command action through the same error callback shape as the real helper. */
export async function runCommandWithRuntimeMock(
_runtime: unknown,
action: () => Promise<void>,
onError: (err: unknown) => void,
) {
return await action().catch(onError);
}
/** Provides a mock module shape for core runCommandWithRuntime imports. */
export async function createBrowserCliUtilsMockModule() {
return { runCommandWithRuntime: runCommandWithRuntimeMock };
}
/** Provides a mock module shape for Browser CLI runtime imports. */
export async function createBrowserCliRuntimeMockModule() {
return await mockBrowserCliDefaultRuntime();
}