Skip to content

Commit e5db861

Browse files
committed
test(19365): declare the run-list double's parameters so recorded calls are readable
Claude-Session: https://claude.ai/code/session_01UDXER3sdqfeVYpEWZs5mZx Co-authored-by: Claude <noreply@anthropic.com>
1 parent b921884 commit e5db861

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

‎packages/runtime/src/domains/automation-runs-query-validation.test.ts‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,16 @@ import { validationFailureDetails, VALIDATION_FAILED_STATUS } from '../validatio
7777
* window a caller asks for is still the window the service is asked for.
7878
*/
7979
function makeDispatcher(hasMore = false) {
80-
const listRunsPage = vi.fn(async () => ({
81-
runs: [{ id: 'run_1', flowName: 'welcome_flow', status: 'completed' }],
82-
hasMore,
83-
}));
80+
// The parameters are DECLARED, not inferred: an argument-less `vi.fn`
81+
// types `mock.calls` as the empty tuple, so reading the options argument
82+
// off a recorded call is a type error (TS2493) — and the options argument
83+
// is precisely what the preservation rows below exist to inspect.
84+
const listRunsPage = vi.fn(
85+
async (_flowName: string, _options?: Record<string, unknown>) => ({
86+
runs: [{ id: 'run_1', flowName: 'welcome_flow', status: 'completed' }],
87+
hasMore,
88+
}),
89+
);
8490
const services: Record<string, unknown> = { automation: { listRunsPage, handlerReady: true } };
8591
const resolve = (name: string) => services[name];
8692
const kernel: any = {

0 commit comments

Comments
 (0)