-: Now that we have a little bit better idea
of what's going on with chai and mocha,
or at least what the difference between the two is,
we can get started on putting together
our own test helper file here.
So here's what we're gonna do.
We're going to open test_helper.js.
We're gonna select everything
and we're gonna delete it all. (chuckles)
Every last piece of it.
We'll save the file and there we go.
It's all done for.
Now you can see all of our specs are failing.
So we're gonna keep going
and we're gonna fix this thing up
until we can run all of our specs and keep them green again.
And hopefully we'll learn some stuff
about our testing set up along the way, as well.
So our test helper was really doing
a couple very useful things for us.
Probably two, three, or four different things.
And just for the sake of,
you know, trying to be kinda direct in the instruction here,
I'm gonna list down what the four or so
things it was doing for us were,
and that's gonna be basically our targets
in the coming videos of what we're gonna try to reimplement.
So the first thing that we're gonna do,
and of course keep in mind,
we'll talk it in great detail about each of these steps,
we need to,
Set up
testing environment
to run like a browser
in the command line.
And so again, we'll talk about exactly what I mean by that.
Next,
we need to, build
render
component
helper,
that should render a given
react element.
Well we'll say, react class.
Next, we need to,
build helper for
simulating events.
And I think that there's one more thing we need to do.
We're gonna say that we need to,
set up chai-jquery.
Yes, chai-jquery.
I always forget whether or not it's,
jquery-chai or chai-jquery
but chai-jquery, we'll leave it that way.
So anyways, these are the four steps that we need to do.
The four things that we need to set up or
you know, make good inside of our test helper file
before our specs are gonna go back to green.
And again, the thought here is that, you know,
with getting a much deeper look at the behind the scenes,
might make it a little bit easier to
tweak your own testing set up in the future.
So the first thing that we're gonna work on
is gonna be setting up our testing environment
to run like a browser but in the command line.
So let's start in the next section
and we'll talk about what exactly I mean by that.
I'll catch you over there.