We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6f7eab8 commit 84392ffCopy full SHA for 84392ff
1 file changed
tests/display.test.js
@@ -0,0 +1,34 @@
1
+// https://www.codegrepper.com/code-examples/javascript/jest+test+if+method+exists
2
+
3
4
+describe('', () => {
5
+ test('', () => {
6
7
+ });
8
+});
9
10
11
12
+// jest.mock("../foo");
13
+// const foo = require("../foo");
14
15
+// test('make sure foo is called', () => {
16
+// expect(foo).toBeCalled();
17
+// });
18
+// test('make sure foo run only once', () => {
19
+// expect(foo.mock.calls.length).toBe(1);
20
21
22
23
24
+// jest.mock("../bar");
25
26
27
+// const bar = require("../bar");
28
29
+// test("functions are called", done => {
30
+// require("../index");
31
32
+// expect(bar.mock.calls.length).toBe(1);
33
+// done();
34
0 commit comments