Check out a free preview of the full Complete Front-End Project: Build a Game course
The "Testing & Type Checking" Lesson is part of the full, Complete Front-End Project: Build a Game course featured in this preview video. Here's what you'd learn in this lesson:
Brian demonstrates how to set up the testing framework Jest, and informs students about what to do if they fall behind.
Transcript from the "Testing & Type Checking" Lesson
[00:00:00]
>> So here, I show you how to set up a testing framework. The one that I choose is Jest, cuz I think it's a great framework. You could use Jasmine, Mocha, AVA, any one of those. They're all great, node tap, node tape. This course ended up running a little bit long, so actually, we don't end up writing any tests for that.
[00:00:14]
Which is not me saying, don't write tests. Tests are good, you should write them. But for this particular course, we're not gonna end up actually writing any tests. So here I'll show you how to set up the testing frameworks. It's actually pretty simple to set up. I mean, it's actually really just this, install Jest, and then put it inside of your scripts.
[00:00:32]
But we're not gonna end up going through that. What I would invite you to do after you finish this course is go write some tests. The code is gonna be written in a pretty testable way. So I think that's a good stretch goal for everybody. And again, along the same lines, there's a whole section here on TypeScript.
[00:00:48]
I'm a big TypeScript fan. I'm technically on the TypeScript team, as well, at Microsoft. The VS Code and the TypeScript team are connected. I love TypeScript. I actually would have written this course in TypeScript, but at the NI Alexa to make it more generally applicable. I didn't want you to have to learn TypeScript and how I write code at the same time.
[00:01:08]
So again, another stretch goal for you is, after we're done with this course, I would invite you to go back and rewrite it in TypeScript. And if you don't understand TypeScript yet, there is a great course from Mike North on Frontend Masters that will teach you TypeScript. Yeah, that's it.
[00:01:22]
I really like TypeScript. It's gonna prevent even more styles of bugs, like the undefined is not a function problem, which I am sure we have all seen before. TypeScript will prevent problems like that, which is great. At this point, we have reached the Frontend infra milestones. So if you go, again, in your project, you'll see the frontend-infra folder, right?
[00:01:44]
That's where we are right now. So you can go ahead and hop forward to that if you want to, or fell behind, or something like that.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops