env:
  global:
    - CC_TEST_REPORTER_ID=xxx
language: node_js
node_js:
  - "8"
cache:
  npm: true # this cashes ~/.npm folder on Travis
before_install:
  - echo "//npm.pkg.github.com/:_authToken=${NPM_TOKEN}" >> .npmrc
install:
  - npm ci
script:
  - npm run test:coverage
before_script:
  - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
  - chmod +x ./cc-test-reporter
  - ./cc-test-reporter before-build
after_script:
  - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
