I am trying to figure out why this is not working Code coverage | GitLab
this is my yaml
# .gitlab-ci.yml
image: node:12
# Define the stages of the pipeline
stages:
- test
cache:
paths:
- node_modules/
# Define the job that will run tests
test:
stage: test
script:
- npm install
- npm run test -- --coverage --verbose
artifacts:
when: always
paths:
- junit.xml
- coverage/cobertura-coverage.xml
reports:
coverage_report:
coverage_format: cobertura
path: coverage/cobertura-coverage.xml
junit: junit.xml
# Add coverage to code coverage statistics
coverage: '/All files[^|]*\|[^|]*\s+([\d\.]+)/'
# Define when this job should be executed
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'