OK
Size: a a a
OK
OP
ВТ
OP
OK
OK
ВТ
OK
OK
ES
SK
rmochaOpts: {
retries: 1,
},
OK
ES
OK
OK
ES
OK
export const expectErrorInBody = async (code: () => Promise<any>, contains: string): Promise<void> => {
try {
await code();
} catch (error) {
if (!error?.response?.body?.message) {
throw error
}
expect(error.response.body.message).toContain(contains)
// All good, simply return from function.
return;
}
throw new Error(
`Expected request:
${code}
to be failed with message "${contains}"`)
}
OK
export const expectErrorInBody = async (code: () => Promise<any>, contains: string): Promise<void> => {
try {
await code();
} catch (error) {
if (!error?.response?.body?.message) {
throw error
}
expect(error.response.body.message).toContain(contains)
// All good, simply return from function.
return;
}
throw new Error(
`Expected request:
${code}
to be failed with message "${contains}"`)
}
ВТ
OK