Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Preview
Start a free Courses trial
to watch this video
In this course you’ll practice a way to write JavaScript called Behavior Driven Development -- or BDD.
Related courses
- JavaScript Basics
- Node.js Basics
- Object-Oriented JavaScript
- npm Basics
- JavaScript Loops, Arrays and Objects
Video review
- Tests help us understand the code we want to write -- like an outline
- Tests let us know if our code behaves the way we want it to behave
- Tests tell us when we’ve accidentally broken something
- "Unit tests" focus on small, meaningful chunks of functionality
- Good unit tests are easy to understand
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
[MUSIC]
0:00
Hey everyone, I'm Guil, and
this is JavaScript Unit Testing Basics.
0:04
The material in this course assumes you
know your way around JavaScript objects,
0:08
node, and mpm.
0:13
So make sure you complete
all the prerequisites for
0:14
this course before continuing.
0:17
And if you wanna brush up on some of
those videos, I've included the links and
0:18
the teacher's notes as well.
0:23
In this course, you'll practice
a way to write JavaScript called,
0:24
Behavior Driven Development or BDD.
0:29
In BDD we write special functions,
called tests, for
0:31
our application before we
actually write any real code.
0:35
These tests describe
how a code should work.
0:39
In other words, tests describe
the expected behavior of our application.
0:42
Having these tests written already
will help us understand the code we
0:47
want to write.
0:51
Like an outline,
as we continue writing our code
0:52
our tests will let us know as soon as our
programs behave the way we want them to.
0:55
They'll also tell us when we've
accidentally broken something
1:00
along the way.
1:02
We'll build up our tests to cover one
small unit of our code at a time.
1:04
This style of testing
is called unit testing.
1:08
Since unit tests focus on small,
1:11
meaningful chunks of functionality,
good unit tests are easy to understand.
1:13
They prove that each piece of
our code does what we want.
1:18
In the next video,
1:22
I'll cover some of the ways unit
testing makes development easier.
1:23
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