Bummer! You must be logged in to access this page.
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, I’ll share some of my expansions to the 'checkForShip' test suite.
Resources
Video review
- We might have to adjust our functions as we go
- It’s ok to throw away code that was working, even if you spent time writing tests for it already; it's one of the biggest benefits of having unit tests
- Our unit tests will tell us exactly what breaks, and how, as we rebuild parts of our code
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
So here's how I wrote my test suite for
the fire function.
0:00
All right.
So first,
0:02
I'll set up my test suite at
the bottom of the shiptest.js file.
0:03
The test suite is named fire, so I'll pass
fire as the string followed by a function.
0:11
Then I’ll import the fire
function at the top.
0:26
So it's available to all my specs.
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