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!
Preview
In this video, we’ll meet a powerful testing framework called Mocha.js. We can use an assertion library called Chai that makes our tests nice to read and easy to understand.
Video review
- To have Mocha and Chai in your project, type
npm install --save-dev mocha chai - The
--save-devflag means that these tools are just for development
Resources
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
Behavior Driven Development or BDD.
0:00
It means, we write unit test as a guide or
0:02
outline before we start
writing our application code.
0:04
We practice the strategy using
an expectation library called chai.
0:07
In the example code we wrote,
0:12
our expectation functions were
included directly in our running code.
0:14
And they didn't have significantly better
output than console dot log statements.
0:18
As you'll learn in this
section of the course,
0:23
the professional approach to writing
unit tests is to put your test code in
0:25
a file that's separate from
your applications code.
0:29
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