Mocha and Chai are unit testing and assertion libraries. In this exercise, Kent demonstrates how to get an initial test runner set up in the library. He creates an index.test.js file which will contain the test scripts and a mocha.opts file for configuring Mocha. The solution to this exercise is on the FEM/05.0-setup-tests branch.
- The next thing we're going to talk about is testing.…So how many people here…have used Mocha before in their lives?…Okay sweet, Jasmine?…Anybody used Jasmine?…What other, QUnit?…Yep, good old days.…They're still running strong, right? So, cool.…Yeah, so I prefer Mocha, I've used,…I don't think I've ever used QUnit actually…but I like Mocha, I also like Ava.…Ava is great, too.…I like Chai when I use Mocha.…
It's a really great assertion library…but you also have the expect library that's a good one.…What we're going to use in this project, though,…is Mocha and Chai, we're only going to need a couple…of tests because goodness gracious, we only have…two points of contact with our API…and that's actually kind of an argument…for micro-libraries is that unique random array…is so awesome because it is fully tested,…100% code coverage so we can just use it…and then we don't have to test it.…We can just rely on that working…and then we can test the stuff that is important to us.…
For this exercise, we're going to…install those dependencies, like I said,…
Note: This course was created by Frontend Masters. It was originally released on 08/09/2016. We're pleased to host this training in our library.
- Creating an open-source library
- Linting and testing
- Code coverage
- Installing and configuring Babel
- Peer dependencies
- Forking and renaming
- Continuous integration and automating releases
Skill Level Intermediate
1. Creating an Open-Source Library
2. Linting and Testing
3. Git Hooks, Babel, and Webpack
4. Continuous Integration and Automating Releases
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.