language: node_js
node_js:
  - 6
  - 8
  - 10

script: npm run test:src

jobs:
  include:
    - stage: other
      script: npm run lint
      node_js: lts/*
      name: Lint
    - script: npm run test:browser
      node_js: lts/*
      name: Local Browser Test
    - script: 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then npm run test:browserstack; else true; fi'
      node_js: lts/*
      name: Browserstack Test
    - script: npm run build && npm run test:dist
      node_js: lts/*
      name: Bundling Test
    - script: npm run coverage && npx codecov
      node_js: lts/*
      name: Coverage
git:
  depth: 5

cache:
  directories:
    - node_modules
