We’ll be building a basic node application and add continuous integration to it using travis-ci.

Now first things first! What the heck is CI.

A CI process is a process in which software is developed by multiple sources and is automatically integrated via an established procedure. The flow might go something like this:

  1. Push to Git
  2. A process is triggered
  3. The relevant branch is pulled, the app is built, and tests are run
  4. The results of this process are sent to whom it concerns

If all tests pass, it means the code can be safely (well, safely in the areas the tests cover) be merged into the main branch.

I guess that’s enough for basics. Lets’s dive into coding part now!

Let’s start coding!

For starters we want a very basic node app.

  1. Create a directory in your system with any project name you want, cd into it and run npm init -y . This will create a package.json file.
  2. We’ll be using express to create a server and mocha, supertest and should for testing. Install these dependencies with **npm i express mocha supertest should . **Afer running this command your package.json file should look like this.

Image for post

#travis-ci #github #tutorial #nodejs #continuous-integration

Continuous Integration Using Travis (Nodejs)
1.60 GEEK