1 00:00:06,540 --> 00:00:07,373 - Hello again, 2 00:00:07,373 --> 00:00:08,940 and welcome to Lesson 2. 3 00:00:08,940 --> 00:00:12,270 This lesson is all about Jest matchers. 4 00:00:12,270 --> 00:00:15,420 Jest matchers are functions in the Jest library 5 00:00:15,420 --> 00:00:19,980 that enable you to write tests concisely and expressively. 6 00:00:19,980 --> 00:00:21,630 We'll begin with a look at matchers 7 00:00:21,630 --> 00:00:25,200 for test inequality, range, and null, 8 00:00:25,200 --> 00:00:29,340 undefined, not a number, and true and false. 9 00:00:29,340 --> 00:00:30,819 Then we'll see how to use Jest matchers 10 00:00:30,819 --> 00:00:33,360 to test properties in objects 11 00:00:33,360 --> 00:00:36,270 and how to test the elements in a collection. 12 00:00:36,270 --> 00:00:38,760 We'll also see how to test for errors. 13 00:00:38,760 --> 00:00:39,870 If we call a function 14 00:00:39,870 --> 00:00:41,640 and expect an error to occur, 15 00:00:41,640 --> 00:00:44,040 we can test that the function did actually cause 16 00:00:44,040 --> 00:00:46,200 the error to occur. 17 00:00:46,200 --> 00:00:47,340 At the end of the lesson, 18 00:00:47,340 --> 00:00:50,250 we'll see how to extend the Jest matcher library 19 00:00:50,250 --> 00:00:52,080 by writing our own custom matchers, 20 00:00:52,080 --> 00:00:56,103 for example, to test if a string is a valid postcode 21 00:00:56,103 --> 00:00:57,963 or something like that.