Quiz Yourself on Mocking

This quiz will test what you have learned in this chapter.

We'll cover the following...
Technical Quiz
1.

(Select all that apply.) What expectations pass after the following code is executed?

const mock = jest.fn();
mock(1);
mock(2);
 Multi-select
A.
expect(mock).toBeCalled();
B.
expect(mock).toBeCalledTimes(1);
C.
expect(mock).toBeCalledTimes(2);
D.
expect(mock).toBeCalledWith(1);
E.
expect(mock).toBeCalledWith(2);

1 / 8