chore: update tests

This commit is contained in:
Simon
2026-06-11 20:06:35 +08:00
parent edb769b826
commit 4828f9f726

View File

@@ -297,18 +297,8 @@ describe.concurrent('PageAgentCore lifecycle', () => {
})
it('re-throws and sets error status when onAfterStep throws', async () => {
// `done` breaks before onAfterStep, so use a non-terminal action.
const fetchMock = createFetchMock().mockResolvedValueOnce(
agentResponse({ action: { noop: {} } })
)
const fetchMock = createFetchMock().mockResolvedValueOnce(doneResponse('all done'))
const agent = createAgent(fetchMock, {
customTools: {
noop: tool({
description: 'No-op.',
inputSchema: z.object({}),
execute: async () => 'ok',
}),
},
onAfterStep: async () => {
throw new Error('after step failed')
},