version: 2
jobs:
    build:
        docker:
            - image: node:latest
              user: node
        steps:
            - checkout
            - restore_cache:
                key: dependencies-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ checksum "package.json" }}
            - run: npm install
            - save_cache:
                key: dependencies-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ checksum "package.json" }}
                paths:
                  - node_modules
            - run: npm test
            - store_artifacts:
                path: coverage
