Skip to content

Instantly share code, notes, and snippets.

@thisismydesign
Created February 10, 2019 02:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thisismydesign/f5fae664c56c78372ced1bd6e8b86e59 to your computer and use it in GitHub Desktop.
Save thisismydesign/f5fae664c56c78372ced1bd6e8b86e59 to your computer and use it in GitHub Desktop.
Mocking per test case with Jest /1
describe("<Component />", () => {
it("works", () => {
// ...
}):
describe("when something silly happens", () => {
beforeEach(() => {
jest.mock("MyOtherComponent", () => {
// ...
})
});
it("works differently", () => {
// ...
}):
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment