Hi,
I have jest referenced as a dev dependency and as part of my job I am updating packages. I have output node-modules folder content, and jest is there, still, the unit tests step fails due to a missing package error (the error: missing script: /home/circleci/ci-root/node_modules/jest/bin/jest)
Please help me here, going around this for some time now
My config.yml
version: 2
jobs:
checkout:
docker:
- image: circleci/node:11.10
working_directory: ~/ci-root
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum “package.json” }}
- run:
name: Install Dependencies
command: npm install
- save_cache:
key: dependency-cache-{{ checksum “package.json” }}
paths:
- ./node_modules
- persist_to_workspace:
root: ~/
paths:
- ci-root
test:
docker:
- image: circleci/node:11.10
working_directory: ~/ci-root
steps:
- attach_workspace:
at: ~/
- run:
name: Install Dependencies
command: npm install
- run: # run tests
name: Install unit test framework
command: npm add --save-dev jest-junit
- run:
name: Run unit tests
command: npm run ~/ci-root/node_modules/jest/bin/jest --ci --runInBand --reporters=default --reporters=jest-junit
environment:
JEST_JUNIT_OUTPUT: “test-results/jest/results.xml”
- store_test_results:
path: test-results
workflows:
version: 2
Continuos Integration:
jobs:
- checkout
- test:
requires:
- checkout