defaults: &defaults
  working_directory: ~/repo
  docker:
    - image: quramy/node-nightmare
      environment:
        DISPLAY: ":99"

version: 2
jobs:
  build:
    <<: *defaults
    steps:
      - checkout
#     # Download and cache dependencies
#     - restore_cache:
#         keys:
#         - v1-dependencies-{{ checksum "yarn.lock" }}
#         # fallback to using the latest cache if no exact match is found
#         - v1-dependencies-

      - run: yarn install

      - run: |
          cd examples/jasmine/
          yarn install
          cd ../..

      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "yarn.lock" }}
        
      # run tests!
      - run: |
          xvfbd start
          yarn test
          xvfbd stop

      - run: yarn run reg

