From ed78737768af647186902e16b9ac21ae43afe9ae Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 13 Oct 2022 15:19:26 +0100 Subject: [PATCH] Fix types on utils UTs --- spec/unit/http-api/utils.spec.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/unit/http-api/utils.spec.ts b/spec/unit/http-api/utils.spec.ts index 1a266c842..6630b0199 100644 --- a/spec/unit/http-api/utils.spec.ts +++ b/spec/unit/http-api/utils.spec.ts @@ -19,6 +19,7 @@ import { mocked } from "jest-mock"; import { anySignal, ConnectionError, + HTTPError, MatrixError, parseErrorResponse, retryNetworkOperation, @@ -121,7 +122,7 @@ describe("parseErrorResponse", () => { }, }, status: 500, - } as Response, '{"errcode": "TEST"}')).toStrictEqual(new Error("Server returned 500 error")); + } as Response, '{"errcode": "TEST"}')).toStrictEqual(new HTTPError("Server returned 500 error", 500)); }); it("should handle invalid type gracefully", () => { @@ -144,7 +145,7 @@ describe("parseErrorResponse", () => { }, }, status: 418, - } as Response, "I'm a teapot")).toStrictEqual(new Error("Server returned 418 error: I'm a teapot")); + } as Response, "I'm a teapot")).toStrictEqual(new HTTPError("Server returned 418 error: I'm a teapot", 418)); }); });