stages:
  - test
test:
  stage: test
  image: node:15-buster-slim
  variables: 
    PATH: "$PATH:/$CI_PROJECT_DIR/node_modules/.bin"
  cache:
    key: "pnpm-cache"
    paths:
      - "$CI_PROJECT_DIR/.pnpm-store"
  before_script:
    - npm install -g pnpm
    - pnpm install
  script:
    - jest src/ --coverage --coverageReporters cobertura
  coverage: /All\sfiles.*?\s+(\d+.\d+)/
  artifacts:
    reports:
      cobertura: "$CI_PROJECT_DIR/coverage/cobertura-coverage.xml"
