fix(cron): improve test helper error reporting for lastEmbeddedCall
Replace embedded expect assertion with an explicit throw so failures report at the call-site rather than inside the helper, making it easier to identify which test case triggered the problem.
This commit is contained in:
parent
40e262874a
commit
b7c09cba44
@ -28,8 +28,9 @@ const withTempHome = withTempCronHome;
|
||||
*/
|
||||
function lastEmbeddedCall(): { provider?: string; model?: string } {
|
||||
const calls = vi.mocked(runEmbeddedPiAgent).mock.calls;
|
||||
expect(calls.length).toBeGreaterThan(0);
|
||||
return calls.at(-1)?.[0] as { provider?: string; model?: string };
|
||||
const last = calls.at(-1)?.[0] as { provider?: string; model?: string } | undefined;
|
||||
if (!last) throw new Error("runEmbeddedPiAgent was never called");
|
||||
return last;
|
||||
}
|
||||
|
||||
async function runCronWithModel(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user