language: node_js
node_js:
  - "5"

env:
  - PUBLISH_DIR=$TRAVIS_BUILD_DIR/gh-pages

# install dependencies and start virtual display for testing
before_script:
  - npm install -g gulp
  - export DISPLAY=:99.0
  - sh -e /etc/init.d/xvfb start

script: gulp ci
after_success: |
  if [ $TRAVIS_BRANCH == 'master' -a $TRAVIS_PUBLISH_PAGES == 'true' -a -n $GITHUB_API_KEY ]; then
    git clone https://github.com/$TRAVIS_REPO_SLUG.git --branch gh-pages "$PUBLISH_DIR"
    make publish
    cd "$PUBLISH_DIR"
    git add --all
    git -c user.name='Travis CI' -c user.email='travis' commit -m "Travis build $TRAVIS_BUILD_NUMBER"
    git push -q https://cyChop:$GITHUB_API_KEY@github.com/$TRAVIS_REPO_SLUG.git
    cd $TRAVIS_BUILD_DIR
  fi
  if [ $TRAVIS_PULL_REQUEST == false -a $TRAVIS_BRANCH == 'quality' ]; then
    wget https://raw.githubusercontent.com/cyChop/dev-resources/master/gulp/sonar/sonar.config.js
    gulp sonar
  fi

language: node_js
node_js:
  - "5"

env:
  - PUBLISH_DIR=$TRAVIS_BUILD_DIR/gh-pages

# install dependencies and start virtual display for testing
before_script:
  - npm install -g gulp karma
  - export DISPLAY=:99.0
  - sh -e /etc/init.d/xvfb start

script: gulp ci
after_success: |
  if [ $TRAVIS_BRANCH == 'master' -a $TRAVIS_PUBLISH_PAGES == 'true' -a -n $GITHUB_API_KEY ]; then
    git clone https://github.com/$TRAVIS_REPO_SLUG.git --branch gh-pages "$PUBLISH_DIR"
    make publish
    cd "$PUBLISH_DIR"
    git add --all
    git -c user.name='Travis CI' -c user.email='travis' commit -m "Travis build $TRAVIS_BUILD_NUMBER"
    git push -q https://cyChop:$GITHUB_API_KEY@github.com/$TRAVIS_REPO_SLUG.git
    cd $TRAVIS_BUILD_DIR
  fi
  if [ $TRAVIS_PULL_REQUEST == false -a $TRAVIS_BRANCH == 'quality' ]; then
    wget https://raw.githubusercontent.com/cyChop/dev-resources/master/gulp/sonar/sonar.config.js
    gulp sonar
  fi

Add Karma to Travis's global NPM dependencies
Add Karma to Travis's global NPM dependencies