feat: 请求层泛型化并收紧默认超时

This commit is contained in:
2026-08-27 21:48:28 +08:00
parent 468bba8670
commit f1fcae0dac
8 changed files with 130 additions and 68 deletions
+8 -4
View File
@@ -22,10 +22,14 @@ describe('reportFragments API', () => {
it('createFragments sends POST with sessionNum and content', async () => {
mockedRequest.post.mockResolvedValue({ code: 200, data: { id: 1 } })
const result = await createFragments('S001', '学习了递归')
expect(mockedRequest.post).toHaveBeenCalledWith('/report-fragments', {
sessionNum: 'S001',
content: '学习了递归',
})
expect(mockedRequest.post).toHaveBeenCalledWith(
'/report-fragments',
{
sessionNum: 'S001',
content: '学习了递归',
},
{ timeout: 300000 },
)
expect(result).toEqual({ code: 200, data: { id: 1 } })
})
})