# https://docs.travis-ci.com/user/languages/javascript-with-nodejs/
language: node_js
dist: trusty
# https://docs.travis-ci.com/user/gui-and-headless-browsers/#using-the-chrome-addon-in-the-headless-mode
addons:
  chrome: stable
node_js:
  - 10
  - 8
sudo: false
before_script:
  - sh test/server-start.sh &
  - SERVER_PID=$!
  - sleep 1
  - which google-chrome-stable && google-chrome-stable --version
after_script:
  - kill $SERVER_PID
script: "npm test && npm run-script lint"
cache:
  directories:
    - node_modules

# https://docs.travis-ci.com/user/languages/javascript-with-nodejs/
language: node_js
dist: trusty
node_js:
  - 10
  - 8
addons:
  chrome: stable

# allow headful tests
# https://github.com/GoogleChrome/puppeteer/blob/v1.11.0/docs/troubleshooting.md#running-puppeteer-on-travis-ci
before_install:
  # Enable user namespace cloning
  - "sysctl kernel.unprivileged_userns_clone=1"
  # Launch XVFB
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"
  # Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
  - "export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true"
  # Point Phantomas to Chrome stable binary provided by Travis
  - "export PHANTOMAS_CHROMIUM_EXECUTABLE=`which google-chrome-stable`"
  - env && google-chrome-stable --version

before_script:
  - sh test/server-start.sh &
  - SERVER_PID=$!
  - sleep 1
after_script:
  - kill $SERVER_PID
script: "npm test && npm run-script lint"
cache:
  directories:
    - node_modules

Set up Travis for Chrome stable
Set up Travis for Chrome stable
