Created
December 16, 2020 02:15
-
-
Save Kalimaha/ec02236f4f883f705660866515933392 to your computer and use it in GitHub Desktop.
FFS
This file contains 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 { eggs } from "../src/eggs"; | |
import { spam } from "../src/spam"; | |
describe("normal", () => { | |
it("does some calculations", () => { | |
expect(eggs(3)).toEqual(72); | |
}); | |
}); | |
describe("mocked", () => { | |
// Override `spam` to return 100 | |
it("does some calculations", () => { | |
expect(eggs(3)).toEqual(142); | |
}); | |
}); |
This file contains 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 { spam } from "./spam"; | |
export const eggs = (a: number) => 42 + spam(a); |
This file contains 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
export const spam = (a: number): number => 10 * a; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment