version: 2

jobs:
  build:
    docker:
      - image: circleci/node:10
    steps:
      - checkout
      - run: npm ci
      - run: 
          name: Unit Tests
          command: |
            mkdir junit
            npm run --silent test > junit/tests.xml
          when: always
      - store_test_results:
          path: junit
workflows:
  version: 2
  build_and_test:
    jobs:
      - build