Using Travis to run tests with every push
So, we have a test as seen in the first section of this chapter. And as we move on with our work, we want all of our tests to run before and after we push our code. Before pushing is easy; you run them, or as you will see later on, we set up Gulp to do that for us. But for now, we will get all the tests to run after we push to GitHub, thanks to Travis CI at https://travis-ci.org/:
So, in this section, we will set our App so that when we push to GitHub, we trigger a test on Travis. By the time we are done, we will have a badge
on our repo showing the status of our project as well:
Getting ready
I will walk through the steps, but to begin with, sign into https://travis-ci.org/ using your GitHub account. So, first log in to GitHub, then when you visit Travis, you will see Sign in with GitHub on the top right.
The rest of the work I will take step by step.
How to do it...
First, we will make the
.travis.xml
file in the root of our application. For now, ours...