1 | import * as app from "./index";
|
2 | import * as math from "./math";
|
3 |
|
4 | math.add = jest.fn();
|
5 | math.subtract = jest.fn();
|
6 |
|
7 | test("calls math.add", () => {
|
8 | app.doAdd(1, 2);
|
9 | expect(math.add).toHaveBeenCalledWith(1, 2);
|
10 | });
|
11 |
|
12 | test("calls math.subtract", () => {
|
13 | app.doSubtract(1, 2);
|
14 | expect(math.subtract).toHaveBeenCalledWith(1, 2);
|
15 | });
|