# Chrome installation is based on
# http://blog.500tech.com/setting-up-travis-ci-to-run-tests-on-latest-google-chrome-version/
# and official doc
# https://docs.travis-ci.com/user/gui-and-headless-browsers/

language: node_js
node_js:
  - "5.1"

compiler: clang-3.6

env:
  - CXX=clang-3.6

sudo: true

addons:
  apt:
    sources:
      - llvm-toolchain-precise-3.6
      - ubuntu-toolchain-r-test
    packages:
      - clang-3.6
      - g++-4.8

before_install:
  - sudo apt-get update
  - sudo apt-get install -y libappindicator1 fonts-liberation
  - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
  - sudo dpkg -i google-chrome*.deb

#script to install dependencies
install:
  - npm i protractor karma-cli webpack typings webpack-dev-server -g
  - npm i
  - npm run lint
  - npm run pree2e

before_script:
  - npm start
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"
  - sleep 3

#Run tests
script:
  - npm run ci

# Chrome installation is based on
# http://blog.500tech.com/setting-up-travis-ci-to-run-tests-on-latest-google-chrome-version/
# and official doc
# https://docs.travis-ci.com/user/gui-and-headless-browsers/

language: node_js
node_js:
  - "5.1"

compiler: clang-3.6

env:
  - CXX=clang-3.6

sudo: true

addons:
  apt:
    sources:
      - llvm-toolchain-precise-3.6
      - ubuntu-toolchain-r-test
    packages:
      - clang-3.6
      - g++-4.8

before_install:
  - sudo apt-get update
  - sudo apt-get install -y libappindicator1 fonts-liberation
  - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
  - sudo dpkg -i google-chrome*.deb

#script to install dependencies
install:
  - npm i protractor karma-cli webpack typings webpack-dev-server -g
  - npm i
  - npm run lint
  - npm run pree2e

before_script:
  - "npm start &"
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"
  - sleep 3

#Run tests
script:
  - npm run ci

Make server run in background
Make server run in background
