version: 2 jobs: build: working_directory: ~ docker: - image: circleci/node:4.8.2 steps: - checkout - run: name: update-npm command: 'sudo npm install -g npm@latest' - restore_cache: key: dependency-cache-{{ checksum "package.json" }} - run: name: install-npm-wee command: npm install - save_cache: key: dependency-cache-{{ checksum "package.json" }} paths: - ./node_modules - run: name: test command: npm test - run: name: code-coverage command: './node_modules/.bin/nyc report --reporter=text-lcov' - store_artifacts: path: test-results.xml prefix: tests - store_artifacts: path: coverage prefix: coverage - store_test_results: path: test-results.xml