Skip to content

Commit de36116

Browse files
committed
fix: update error handling in REST private tests to accommodate multiple authentication error messages
1 parent 8e7b2fb commit de36116

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

test/REST/private.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,17 @@ describe('REST PRIVATE', () => {
9494
whatever: true,
9595
});
9696
} catch (e: any) {
97-
const authSuccessMatchError = 'Invalid sub_account_from';
98-
if (e.body.message !== authSuccessMatchError) {
97+
const authSuccessMatchErrors = [
98+
'Invalid sub_account_from',
99+
'Invalid request parameter `sub_account_from` value: notReal1',
100+
];
101+
if (!authSuccessMatchErrors.includes(e.body?.message)) {
99102
console.error(
100103
`Request failed for test: "${expect.getState().currentTestName}"`,
101104
e,
102105
);
103106
}
104-
expect(e.body?.message).toStrictEqual(authSuccessMatchError);
107+
expect(authSuccessMatchErrors).toContain(e.body?.message);
105108
}
106109
});
107110

0 commit comments

Comments
 (0)