Skip to content

Instantly share code, notes, and snippets.

@gasserkl
Created September 8, 2021 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gasserkl/2be1e8798d500cd42b673da37c9f0b29 to your computer and use it in GitHub Desktop.
Save gasserkl/2be1e8798d500cd42b673da37c9f0b29 to your computer and use it in GitHub Desktop.
import { loginUser } from "./functions";
import { mocked } from "ts-jest/utils";
jest.mock("./functions");
const loginUserMock = mocked(loginUser);
describe("App", () => {
beforeEach(() => {
loginUserMock.mockResolvedValue({
loginSucceeded: false,
});
});
// ...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment