import type { BrowserCommand } from 'vitest/node' import { visContext } from '../vis_context.ts' import { assertTestPathDefined } from './_assertions.ts' export interface ImageSnapshotNextIndexCommand { /** * Get the index of the snapshot image to be created. */ imageSnapshotNextIndex(taskId: string): Promise } export const imageSnapshotNextIndex: BrowserCommand<[taskId: string]> = async (context, taskId) => { assertTestPathDefined(context, 'imageSnapshotNextIndex') return visContext.getTaskCount(context, taskId) }