Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/__tests__/lib/api/resources/ContactExports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ describe("lib/api/resources/ContactExports: ", () => {
} catch (error) {
expect(error).toBeInstanceOf(MailtrapError);
if (error instanceof MailtrapError) {
// axios logger returns "[object Object]" for error objects, so we check for that
expect(error.message).toBe("[object Object]");
// When errors object doesn't match recognized pattern, falls back to default Axios error message
expect(error.message).toBe("Request failed with status code 422");
}
}
});
Expand Down
8 changes: 3 additions & 5 deletions src/__tests__/lib/api/resources/ContactImports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,9 @@ describe("lib/api/resources/ContactImports: ", () => {
} catch (error) {
expect(error).toBeInstanceOf(MailtrapError);
if (error instanceof MailtrapError) {
// Note: Current axios-logger doesn't properly handle array of objects format,
// so it falls back to stringifying the array, resulting in [object Object],[object Object]
// This test documents the current behavior. Updating axios-logger to properly
// parse this format will be a separate task.
expect(error.message).toBe("[object Object],[object Object]");
expect(error.message).toBe(
"invalid-email-1: email: is invalid, is required | invalid-email-2: Contact limit exceeded"
);
}
}
});
Expand Down
Loading