From 78cf68158087e0de92a5072d06ddaa3426a19b8a Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 15 Nov 2024 14:41:05 +0000 Subject: [PATCH] ignore types for direct mockImpl calls --- .../src/middleware/tests/contentSecurityPolicy.spec.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/backend-core/src/middleware/tests/contentSecurityPolicy.spec.ts b/packages/backend-core/src/middleware/tests/contentSecurityPolicy.spec.ts index 745c94fcef..0c5838e7fe 100644 --- a/packages/backend-core/src/middleware/tests/contentSecurityPolicy.spec.ts +++ b/packages/backend-core/src/middleware/tests/contentSecurityPolicy.spec.ts @@ -17,6 +17,7 @@ describe("contentSecurityPolicy middleware", () => { set: jest.fn(), } next = jest.fn() + // @ts-ignore crypto.randomBytes.mockReturnValue(Buffer.from(mockNonce, "base64")) }) @@ -58,6 +59,7 @@ describe("contentSecurityPolicy middleware", () => { it("should handle errors and log an error message", async () => { const consoleSpy = jest.spyOn(console, "error").mockImplementation() const error = new Error("Test error") + // @ts-ignore crypto.randomBytes.mockImplementation(() => { throw error })