1 00:00:06,510 --> 00:00:09,270 - Hello again, and welcome to lesson five. 2 00:00:09,270 --> 00:00:12,390 This is the first of two lessons on mocking. 3 00:00:12,390 --> 00:00:15,960 We begin by showing how to define a mock function in Jest 4 00:00:15,960 --> 00:00:18,900 and how to use the mock property to gain insight 5 00:00:18,900 --> 00:00:21,483 into how the mock function was called by our code. 6 00:00:22,470 --> 00:00:26,700 Then we'll see how to use mock functions to mock an API 7 00:00:26,700 --> 00:00:28,380 and how to mock all the functions 8 00:00:28,380 --> 00:00:30,393 in an entire JavaScript model. 9 00:00:31,380 --> 00:00:34,830 To wrap up the lesson, we'll see how to test promises 10 00:00:34,830 --> 00:00:39,063 and show how to use these techniques to mock REST calls.