version: 2
jobs:
  build:
    working_directory: ~/repo
    docker:
      - image: circleci/node:latest
    steps:
      - checkout
      - restore_cache:
          key: dependency-cache-{{ checksum "package.json" }}
      - run:
          name: install-npm-wee
          command: npm install --legacy-peer-deps
      - save_cache:
          key: dependency-cache-{{ checksum "package.json" }}
          paths:
            - ./node_modules
      - run:
          name: test
          command: npm test
#      - run:
#          name: build
#          command: npm run build
#      - run:
#          name: Authenticate with registry
#          command: echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" > ~/repo/.npmrc
#      - run:
#          name: publish
#          command: npm publish --access public