Skip to content

Commit

Permalink
More tests to satisfy sonarcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
kegsay committed Oct 14, 2022
1 parent e32dfcc commit 500601e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/unit/http-api/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ describe("parseErrorResponse", () => {
}, 500, "https://example.com"));
});

it("should set a sensible default error message on MatrixError", () => {
let err = new MatrixError();
expect(err.message).toEqual("MatrixError: Unknown message");
err = new MatrixError({
error: "Oh no",
});
expect(err.message).toEqual("MatrixError: Oh no");
});

it("should handle no type gracefully", () => {
expect(parseErrorResponse({
headers: {
Expand Down

0 comments on commit 500601e

Please sign in to comment.