version: 2
jobs:
  build:
    working_directory: ~/onvif-nvt
    docker:
      - image: circleci/node:9.4.0
    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: test-and-code-coverage
          command: npm run test-ci
      # - store_artifacts:
      #     path: test-results.xml
      #     prefix: tests
      # - store_artifacts:
      #     path: coverage
      #     prefix: coverage
      # - store_test_results:
      #     path: test-results.xml
