Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
- Getting Started with Mocha and Chai 3:16
- General Structure of Test Files 4:10
- Setting Up Mocha 4 questions
- Installing Mocha 1 objective
- Installing Chai 1 objective
- Test Suites and Test Specs (describe and it) 3:34
- Mocha Chai Basics 4 questions
- Writing Our First Test Suite 14:49
- Writing Our First Test Suite - Part 2 8:15
- Challenge: Expanding Our Expectations 9:57
- Answer: Expanding Our Expectations 12:05
- A Testing Test! 1 objective
- Assert Your Knowledge 5 questions

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
In this video, we’ll go over the specific way Mocha expects us to organize our files in order to run properly.
Related workshop
- Using npm as a Task Runner – Learn how to customize your package.json file
Video review
- It’s important that the test directory is specifically named "test" (not "tests" or "Test"), and it has to be located at the same level of your project as the package.json file
- With your test directory in place, you simply run
npm test
, and Mocha will automatically run every test in the test directory
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
aakashkandhari
422 Points1 Answer
-
babyoscar
12,930 Points1 Answer
-
Alejandro Molina
3,997 Points3 Answers
-
Geoffrey Neal
30,298 Points1 Answer
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up