mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-05 23:29:00 +02:00
Merge pull request #33490 from overleaf/em-parse-req-errors-2
Reintroduce custom error types in request validation GitOrigin-RevId: 1985ca04c8fe693fb836b042517d94700343bc46
This commit is contained in:
@@ -54,7 +54,7 @@ describe('parseReq', () => {
|
||||
}),
|
||||
})
|
||||
)
|
||||
).toThrowError(expect.objectContaining({ name: 'ParamsError' }))
|
||||
).toThrowError(expect.objectContaining({ name: 'InvalidParamsError' }))
|
||||
})
|
||||
|
||||
it('should throw an error containing issues if the schema is invalid', () => {
|
||||
@@ -75,9 +75,11 @@ describe('parseReq', () => {
|
||||
)
|
||||
).toThrowError(
|
||||
expect.objectContaining({
|
||||
issues: expect.arrayContaining([
|
||||
expect.objectContaining({ path: ['body', 'name'] }),
|
||||
]),
|
||||
zodError: expect.objectContaining({
|
||||
issues: expect.arrayContaining([
|
||||
expect.objectContaining({ path: ['body', 'name'] }),
|
||||
]),
|
||||
}),
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user