feat: 请求层泛型化并收紧默认超时
This commit is contained in:
@@ -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 } })
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user