# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
  build:
    docker:
      # specify the version you desire here
      - image: regviz/node-xcb

      # Specify service dependencies here if necessary
      # CircleCI maintains a library of pre-built images
      # documented at https://circleci.com/docs/2.0/circleci-images/
      # - image: circleci/mongo:3.4.4

    working_directory: ~/repo

    steps:
      - checkout

      # disable package-lock
      - run: npm config set package-lock false

      # install dependencies
      - run: npm install

      # run tests!
      - run: npm run test

      # run snapshot tests!
      - run: npm run test:snapshot

      # extract snapshot test results
      - run: npm run test:snapshot:extract /tmp/snapshots

      - store_artifacts:
          path: /tmp/snapshots
          destination: snapshots

      - run: useradd screenshot && su - screenshot

      # run visual regression tests
      - run: npm run screenshot

      - store_artifacts:
          path: __screenshots__
          destination: screenshots

      # build!
      - run: npm run build:to /tmp/build

      - store_artifacts:
          path: /tmp/build
          destination: build



# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
  build:
    docker:
      # specify the version you desire here
      - image: regviz/node-xcb

      # Specify service dependencies here if necessary
      # CircleCI maintains a library of pre-built images
      # documented at https://circleci.com/docs/2.0/circleci-images/
      # - image: circleci/mongo:3.4.4

    working_directory: ~/repo

    steps:
      - checkout

      # disable package-lock
      - run: npm config set package-lock false

      # install dependencies
      - run: npm install

      # run tests!
      - run: npm run test

      # run snapshot tests!
      - run: npm run test:snapshot

      # extract snapshot test results
      - run: npm run test:snapshot:extract /tmp/snapshots

      - store_artifacts:
          path: /tmp/snapshots
          destination: snapshots

      # run visual regression tests
      - run: useradd screenshot && su - screenshot && npm run screenshot

      - store_artifacts:
          path: __screenshots__
          destination: screenshots

      # build!
      - run: npm run build:to /tmp/build

      - store_artifacts:
          path: /tmp/build
          destination: build



Downgrade user when creating screenshots
Downgrade user when creating screenshots
