version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:9.2.0-browsers
# 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: ~/RA
# dependencies:
# override:
# - npm install
steps:
- checkout
# Download and cache dependencies
# - restore_cache:
# keys:
# - v1-dependencies-{{ checksum "package.json" }}
# # fallback to using the latest cache if no exact match is found
# - v1-dependencies-
- run:
name: install
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- ./node_modules
- run:
name: start
command: npm run dev
background: true
# - test:
# pre:
# - npm start:
# background: true
# - sleep 5
# override:
# - npm test
# - npm run protractor
- run:
name: Run jest unit tests
environment:
JEST_JUNIT_OUTPUT: /tmp/test-results/junit/js-test-results.xml
E2E_JUNIT: /tmp/test-results/e2e/
command: npm test
- run:
name: Run e2e tests
command: |
sudo npm i -g protractor
sudo webdriver-manager update
protractor
- store_test_results:
path: /tmp/test-results/`Preformatted text`