Skip to content

Commit 93beae5

Browse files
committed
test: Relax expectParseError to check only the numeric code
Internal-server-error bodies use { code, message } rather than { code, error }, so a numeric code is the reliable signal that a rejection is a Parse error.
1 parent b524ba3 commit 93beae5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

spec/helpers/request.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ export async function expectParseError(
9595
await promise;
9696
} catch (e: any) {
9797
const body: ParseErrorBody = e && e.data ? e.data : e;
98-
if (typeof body?.code !== 'number' || typeof body?.error !== 'string') {
98+
if (typeof body?.code !== 'number') {
9999
throw new Error(
100-
`Expected a Parse error ({ code, error }), but got: ${JSON.stringify(body)}`
100+
`Expected a Parse error (numeric code), but got: ${e instanceof Error ? e.stack : JSON.stringify(body)}`
101101
);
102102
}
103103
if (code !== undefined) {

0 commit comments

Comments
 (0)