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
We might need some assertions other than equal. Let’s expand our test suite to be more descriptive and versatile.
Resources
Video review
- Chai's
.empty
method checks for empty objects, arrays, or strings -
.empty
makes it easy to write expectations without worrying about how the real code will work - You call arrays that look the same “deeply equal”, because their “deep” internal values are equal
- The
.deep
method allows you to make deep equality comparisons
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Brian Patterson
19,588 Points1 Answer
-
Sergi Oca
7,981 Points2 Answers
-
Pierre Smith
11,842 PointsBrowser compatibilities with JS Chai Should style framework. Why?
Posted by Pierre SmithPierre Smith
11,842 Points2 Answers
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