"Illustrator Foundations" was retired on January 6, 2020. You are now viewing the recommended replacement.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed JavaScript Unit Testing!
You have completed JavaScript Unit Testing!
In this video, you'll learn to write a test suite using the 'describe()' function, and a test spec using the 'it()' function.
Resources
Video review
- A test suite is a block of unit tests that are all closely related; they test the same function or similar parts of our code base
- We introduce a test suite in Mocha using
describe()
- Each individual unit test is sometimes called a “spec”
- Mocha makes it natural to write specs by containing them in a function called
it()
- To use Chai's
expect
method, import Chai at the top of your file:var expect = require('chai').expect
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated 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