Skip to content

tcbeutler/TravisCITest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

GitHub Pages Coverage Results

hasdocs Coverage Results

Travis CI Testing

##Travis docs - useful links

###Breakdown

  1. Service Hook - Travis CI to GitHub

    a. One-click after GitHub login. All branches at once.

    b. Add .travis.yml file to project root directory.

  2. Unit Tests - Mocha

    a. Set up "npm test" command - this is what Travis runs

    b. Call local installation of mocha, global throws permission errors

    c. Travis posts success/failure/unknown image - can embed in this README (see above.)

  3. Code Coverage - Istanbul

    a. Install Istanbul, Istanbul hooks into Mocha, instruments code from tests, and produces code coverage results.

    • Only instruments code referenced from unit tests.

    b. Tell Travis to execute coverage tests, produces output as html.

    c. TravisCI does not host files, so possible solution is to post back to a GitHub repository using encrypted OAuth token with Travis's public key.

    d. Travis can post back to GitHub, see script example. Possibly can use Travis's environment variables to post back to correct branch, OR separate branch for coverage results, and have Travis create a directory for each branch.

    • echo ${TRAVIS_BRANCH} = "master"
  4. Viewing Code Coverage Results

    a. GitHub cannot display pages hosted in a normal repository.

    b. GitHub Pages hosts a public website from any branch added to a repo called "gh-pages".

    GitHub pages are always public and served over http.

    c. hasdocs provides privately hosted documentation with GitHub service hook for ~$5 a month.

    d. Alternatively could host own service to pull and serve coverage results.

About

Simple testing of Travis CI with node.js and mocha.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published