Skip to content

Commit

Permalink
Added error message check
Browse files Browse the repository at this point in the history
  • Loading branch information
jholleran committed Aug 13, 2024
1 parent 19100a3 commit 16ece5c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions e2e/node/error.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ describe(`End-to-end error description test for ${ENV.environment}`, () => {
"Some error message",
);
expect(error).toBeInstanceOf(UnauthorizedError);
expect(error.message).toBe("Some error message");
expect(error.problemDetails.status).toBe(401);
expect(error.problemDetails.title).toBe("Unauthorized");
expect(error.problemDetails.detail).toBeDefined();
Expand All @@ -104,6 +105,7 @@ describe(`End-to-end error description test for ${ENV.environment}`, () => {
"Some error message",
);
expect(error).toBeInstanceOf(NotFoundError);
expect(error.message).toBe("Some error message");
expect(error.problemDetails.status).toBe(404);
expect(error.problemDetails.title).toBe("Not Found");
expect(error.problemDetails.detail).toBeDefined();
Expand All @@ -124,6 +126,7 @@ describe(`End-to-end error description test for ${ENV.environment}`, () => {
"Some error message",
);
expect(error).toBeInstanceOf(NotAcceptableError);
expect(error.message).toBe("Some error message");
expect(error.problemDetails.status).toBe(406);
expect(error.problemDetails.title).toBe("Not Acceptable");
expect(error.problemDetails.detail).toBeDefined();
Expand All @@ -149,6 +152,7 @@ describe(`End-to-end error description test for ${ENV.environment}`, () => {
"Some error message",
);
expect(error).toBeInstanceOf(BadRequestError);
expect(error.message).toBe("Some error message");
expect(error.problemDetails.status).toBe(400);
expect(error.problemDetails.title).toBe("Bad Request");
expect(error.problemDetails.detail).toBeDefined();
Expand All @@ -167,6 +171,7 @@ describe(`End-to-end error description test for ${ENV.environment}`, () => {
"Some error message",
);
expect(error).toBeInstanceOf(ForbiddenError);
expect(error.message).toBe("Some error message");
expect(error.problemDetails.status).toBe(403);
expect(error.problemDetails.title).toBe("Forbidden");
expect(error.problemDetails.detail).toBeDefined();
Expand Down

0 comments on commit 16ece5c

Please sign in to comment.