1 00:00:01,140 --> 00:00:02,640 -: Now that we have a little bit better idea 2 00:00:02,640 --> 00:00:04,650 of what's going on with chai and mocha, 3 00:00:04,650 --> 00:00:07,260 or at least what the difference between the two is, 4 00:00:07,260 --> 00:00:09,150 we can get started on putting together 5 00:00:09,150 --> 00:00:11,460 our own test helper file here. 6 00:00:11,460 --> 00:00:12,930 So here's what we're gonna do. 7 00:00:12,930 --> 00:00:15,870 We're going to open test_helper.js. 8 00:00:15,870 --> 00:00:17,970 We're gonna select everything 9 00:00:17,970 --> 00:00:20,610 and we're gonna delete it all. (chuckles) 10 00:00:20,610 --> 00:00:21,990 Every last piece of it. 11 00:00:21,990 --> 00:00:24,540 We'll save the file and there we go. 12 00:00:24,540 --> 00:00:25,830 It's all done for. 13 00:00:25,830 --> 00:00:27,840 Now you can see all of our specs are failing. 14 00:00:27,840 --> 00:00:29,460 So we're gonna keep going 15 00:00:29,460 --> 00:00:30,690 and we're gonna fix this thing up 16 00:00:30,690 --> 00:00:34,110 until we can run all of our specs and keep them green again. 17 00:00:34,110 --> 00:00:35,880 And hopefully we'll learn some stuff 18 00:00:35,880 --> 00:00:38,493 about our testing set up along the way, as well. 19 00:00:40,020 --> 00:00:42,120 So our test helper was really doing 20 00:00:42,120 --> 00:00:45,390 a couple very useful things for us. 21 00:00:45,390 --> 00:00:47,940 Probably two, three, or four different things. 22 00:00:47,940 --> 00:00:50,490 And just for the sake of, 23 00:00:50,490 --> 00:00:53,610 you know, trying to be kinda direct in the instruction here, 24 00:00:53,610 --> 00:00:56,100 I'm gonna list down what the four or so 25 00:00:56,100 --> 00:00:58,080 things it was doing for us were, 26 00:00:58,080 --> 00:01:00,360 and that's gonna be basically our targets 27 00:01:00,360 --> 00:01:03,870 in the coming videos of what we're gonna try to reimplement. 28 00:01:03,870 --> 00:01:05,190 So the first thing that we're gonna do, 29 00:01:05,190 --> 00:01:06,720 and of course keep in mind, 30 00:01:06,720 --> 00:01:10,800 we'll talk it in great detail about each of these steps, 31 00:01:10,800 --> 00:01:12,150 we need to, 32 00:01:12,150 --> 00:01:13,920 Set up 33 00:01:13,920 --> 00:01:15,460 testing environment 34 00:01:16,350 --> 00:01:19,770 to run like a browser 35 00:01:19,770 --> 00:01:21,360 in the command line. 36 00:01:21,360 --> 00:01:24,990 And so again, we'll talk about exactly what I mean by that. 37 00:01:24,990 --> 00:01:26,580 Next, 38 00:01:26,580 --> 00:01:27,700 we need to, build 39 00:01:28,560 --> 00:01:30,210 render 40 00:01:30,210 --> 00:01:32,010 component 41 00:01:32,010 --> 00:01:32,843 helper, 42 00:01:33,840 --> 00:01:36,130 that should render a given 43 00:01:37,050 --> 00:01:38,640 react element. 44 00:01:38,640 --> 00:01:40,173 Well we'll say, react class. 45 00:01:41,910 --> 00:01:44,040 Next, we need to, 46 00:01:44,040 --> 00:01:45,690 build helper for 47 00:01:45,690 --> 00:01:48,213 simulating events. 48 00:01:49,200 --> 00:01:51,570 And I think that there's one more thing we need to do. 49 00:01:51,570 --> 00:01:53,250 We're gonna say that we need to, 50 00:01:53,250 --> 00:01:55,923 set up chai-jquery. 51 00:01:59,640 --> 00:02:01,740 Yes, chai-jquery. 52 00:02:01,740 --> 00:02:03,300 I always forget whether or not it's, 53 00:02:03,300 --> 00:02:05,100 jquery-chai or chai-jquery 54 00:02:05,100 --> 00:02:07,830 but chai-jquery, we'll leave it that way. 55 00:02:07,830 --> 00:02:09,960 So anyways, these are the four steps that we need to do. 56 00:02:09,960 --> 00:02:12,510 The four things that we need to set up or 57 00:02:12,510 --> 00:02:15,090 you know, make good inside of our test helper file 58 00:02:15,090 --> 00:02:17,910 before our specs are gonna go back to green. 59 00:02:17,910 --> 00:02:20,130 And again, the thought here is that, you know, 60 00:02:20,130 --> 00:02:23,010 with getting a much deeper look at the behind the scenes, 61 00:02:23,010 --> 00:02:24,720 might make it a little bit easier to 62 00:02:24,720 --> 00:02:27,570 tweak your own testing set up in the future. 63 00:02:27,570 --> 00:02:29,340 So the first thing that we're gonna work on 64 00:02:29,340 --> 00:02:31,830 is gonna be setting up our testing environment 65 00:02:31,830 --> 00:02:35,820 to run like a browser but in the command line. 66 00:02:35,820 --> 00:02:37,800 So let's start in the next section 67 00:02:37,800 --> 00:02:40,623 and we'll talk about what exactly I mean by that. 68 00:02:41,460 --> 00:02:42,760 I'll catch you over there.