1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-07-30 04:23:07 +03:00

More tests to satisfy sonarcloud

This commit is contained in:
Kegan Dougal
2022-10-14 10:23:18 +01:00
parent e32dfccbd9
commit 500601ea85

View File

@ -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: {