Merge pull request #33040 from overleaf/em-parse-req-errors

Replace isZodErrorLike with custom error types in request validation

GitOrigin-RevId: 9cb453a2cde595a00f5049e4829ea9e3dbe17b28
This commit is contained in:
Eric Mc Sween
2026-05-06 08:06:37 +00:00
committed by Copybot
parent 1aa6f03b3c
commit 98def949ec
16 changed files with 100 additions and 80 deletions
@@ -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'] }),
]),
}),
})
)
})