From 2e12b102f7f000b39dcc2213357786ea874f743d Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Mon, 12 Dec 2022 11:16:22 -0500 Subject: [PATCH] Satisfy TS, Deno --- deno/lib/__tests__/catch.test.ts | 2 +- src/__tests__/catch.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deno/lib/__tests__/catch.test.ts b/deno/lib/__tests__/catch.test.ts index 5c3e06911..2e9a6c6fd 100644 --- a/deno/lib/__tests__/catch.test.ts +++ b/deno/lib/__tests__/catch.test.ts @@ -10,7 +10,7 @@ test("basic catch", () => { }); test("catch fn does not run when parsing succeeds", () => { - const cb = jest.fn(); + const cb = jest.fn().mockReturnValue("x") as () => string; expect(z.string().catch(cb).parse("test")).toBe("test"); expect(cb).not.toBeCalled(); }); diff --git a/src/__tests__/catch.test.ts b/src/__tests__/catch.test.ts index a9406536d..04d408a45 100644 --- a/src/__tests__/catch.test.ts +++ b/src/__tests__/catch.test.ts @@ -1,5 +1,5 @@ // @ts-ignore TS6133 -import { expect, test } from "@jest/globals"; +import { expect, jest, test } from "@jest/globals"; import { z } from ".."; import { util } from "../helpers/util"; @@ -9,7 +9,7 @@ test("basic catch", () => { }); test("catch fn does not run when parsing succeeds", () => { - const cb = jest.fn(); + const cb = jest.fn().mockReturnValue("x") as () => string; expect(z.string().catch(cb).parse("test")).toBe("test"); expect(cb).not.toBeCalled(); });