test(server): report routine telemetry mock failure state

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-09-30 17:07:28 -05:00
1 parent 6c70800a66
commit 6ce62cac75
1 file changed
+16 -1
+16 -1
View File
@@ -681,6 +681,21 @@ describe("routine routes", () => {
userId: "board-user",
runId: null,
});
expect(mockTrackRoutineCreated).toHaveBeenCalledWith(expect.anything());
try {
expect(mockTrackRoutineCreated).toHaveBeenCalledWith(expect.anything());
} catch (error) {
// Report mock wiring without importing modules again or changing timing.
console.error("Routine creation telemetry mock diagnostic", {
clientGetterCalls: mockGetTelemetryClient.mock.calls.length,
clientGetterResults: mockGetTelemetryClient.mock.results.slice(-4).map(result => ({
type: result.type,
truthy: Boolean(result.value),
})),
trackingCalls: mockTrackRoutineCreated.mock.calls.length,
createCalls: mockRoutineService.create.mock.calls.length,
activityCalls: mockLogActivity.mock.calls.length,
});
throw error;
}
});
});