Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 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
Mocha allows us to say that a test spec or test suite is asynchronous. In this video, you'll learn how to pass an argument to the internal function of a 'describe' or 'it' block to tell Mocha to wait on running expectations until we specifically say so.
Resources
Video review
- Mocha allows us to say that a test spec or test suite is "asynchronous"
- Passing an argument to the internal function of a
describe()
orit()
block will tell Mocha to wait on running our expectations until we specifically say so - Passing the
done
argument to our test spec tells Mocha that it’s supposed to wait for our instructions before checking our expectations. - Mocha will wait for
done()
to fire before checking the expectations
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
babyoscar
12,930 Points0 Answers
-
Florian Tönjes
Full Stack JavaScript Techdegree Graduate 50,856 Points5 Answers
-
Anthony c
20,907 PointsSo the main takeaway is the expectation moves into a callback?
Posted by Anthony cAnthony c
20,907 Points0 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