dist: trusty
sudo: false
cache:
  directories:
    - node_modules
language: node_js
node_js:
  - "4"
  - "6"
  - "7"
env:
  - TEST_BROWSERS=0
  - TEST_BROWSERS=1
matrix:
  exclude:
    - node_js: "4"
      env: TEST_BROWSERS=1
    - node_js: "7"
      env: TEST_BROWSERS=1
before_script:
  - npm install -g mocha-cli
  # Launch a virtual display imitation for Firefox
  - |
    if [[ "$TEST_BROWSERS" == 1 ]]; then \
      npm install -g karma-cli; \
      export DISPLAY=:99.0; \
      sh -e /etc/init.d/xvfb start; \
      sleep 3; \
    fi
script:
  - npm run-script lint
  - |
    if [[ "$TEST_BROWSERS" == 0 ]]; then \
      npm test; \
    else \
      npm run-script test-browser; \
    fi

dist: trusty
sudo: false
addons:
  - firefox: "45"
cache:
  directories:
    - node_modules
language: node_js
node_js:
  - "4"
  - "6"
  - "7"
env:
  - TEST_BROWSERS=0
  - TEST_BROWSERS=1
matrix:
  exclude:
    - node_js: "4"
      env: TEST_BROWSERS=1
    - node_js: "7"
      env: TEST_BROWSERS=1
before_script:
  - npm install -g mocha-cli
  # Launch a virtual display imitation for Firefox
  - |
    if [[ "$TEST_BROWSERS" == 1 ]]; then \
      npm install -g karma-cli; \
      export DISPLAY=:99.0; \
      sh -e /etc/init.d/xvfb start; \
      sleep 3; \
    fi
script:
  - npm run-script lint
  - |
    if [[ "$TEST_BROWSERS" == 0 ]]; then \
      npm test; \
    else \
      npm run-script test-browser; \
    fi

Set explicit Firefox version in Travis config
Set explicit Firefox version in Travis config
