# https://docs.travis-ci.com/user/languages/javascript-with-nodejs/
language: node_js
dist: xenial
node_js: 10

# 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"

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

# https://docs.travis-ci.com/user/languages/javascript-with-nodejs/
language: node_js
dist: xenial
node_js: 10

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"
  # 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`"

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

Revert "Travis: install Chrome version that is suggested by Puppeteer"
Revert "Travis: install Chrome version that is suggested by Puppeteer"

This reverts commit 0a6e6bbb147a6ee327c2f02ffaed07b717ca1dce.
