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
Our tests provide us an outline for writing our functions, but they can also help us defend against situations we didn’t expect. We’ll write tests that demonstrate the breaking conditions of our functions.
Resources
Video review
- An edge case is a radical situation your function might end up in, but it isn’t how your function would normally work
- Edge cases occur at an extreme (maximum or minimum) operating parameter
- Predicting edge cases can be challenging
- Spend a little time thinking about the edge cases that are most likely to come up
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
It might have been written
by other people, or
0:00
you might have skipped the testing
phase during a chunk of your workflow.
0:01
You should write tests retroactively
just the way we have been in BDD.
0:05
Decide what the function does, and
0:09
focus on that part rather than
the implementation details.
0:11
Write simpler expectations first and
0:16
get them to pass before you
write more involved ones.
0:18
One difference is that you
might get to testing for
0:21
an edge case faster than
you would during BDD.
0:24
An edge case is a radical situation
your function might end up in, but
0:27
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