language: node_js
os:
 - linux
node_js:
  - "12"
  - "11"
  - "10"
  - "9"
  - "8"
  - "7"
  - "6"
  - "5"
  - "4"
  - "iojs"
  - "0.12"
  - "0.10"
before_install:
  - 'nvm install-latest-npm'
install:
  - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;'
script:
  - 'if [ -n "${COVERAGE-}" ] || [ -n "${REACT-}" ]; then case "${TRAVIS_NODE_VERSION}" in [0-3].*) (nvm install lts/* && npm run test:prepare) && nvm current ;; *) npm run test:prepare ;; esac; fi'
  - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi'
  - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi'
  - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi'
  - 'if [ -n "${REACT-}" ]; then npm run test:only; fi'
sudo: false
env:
  - REACT=16
  - REACT=15
  - REACT=15.4
  - REACT=0.14
matrix:
  fast_finish: true
  include:
    - node_js: "lts/*"
      env: PRETEST=true
    - node_js: "lts/*"
      env: COVERAGE=true
  allow_failures:
    - os: osx
    - env: TEST=true ALLOW_FAILURE=true
    - node_js: "11"
    - node_js: "9"
    - node_js: "7"
    - node_js: "5" # babel 7 requires node >= 6
    - node_js: "4" # babel 7 requires node >= 6
    - node_js: "iojs" # babel 7 requires node >= 6
    - node_js: "0.12" # babel 7 requires node >= 6
    - node_js: "0.10" # babel 7 requires node >= 6
