Last active
October 15, 2021 15:42
-
-
Save avilde/48cc27c4e5d0053403b6dbe64177a447 to your computer and use it in GitHub Desktop.
Real life example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { FrontEndDeveloper } from "./FrontEndDeveloper"; | |
import { StackOverflow } from "./StackOverflow"; | |
describe("FrontEndDeveloper tests", () => { | |
it("should still drink coffee", () => { | |
const webDeveloper = new FrontEndDeveloper(); | |
expect(webDeveloper.drinkCoffee()).toContain("coffee ☕"); | |
}); | |
it("should pretend to code", () => { | |
const webDeveloper = new FrontEndDeveloper(); | |
expect(webDeveloper.code()).toContain("'How to write unit tests' (w/o jQuery)"); | |
}); | |
it("should have used StackOverflow while coding", () => { | |
const stackOverflowSearchSpy = jest.spyOn(StackOverflow, "search"); | |
const webDeveloper = new FrontEndDeveloper(); | |
expect(webDeveloper.code()).toContain("'How to write unit tests' (w/o jQuery)"); | |
expect(stackOverflowSearchSpy).toBeCalledWith(expect.stringContaining("unit tests")); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment