Commit b0d9dc90 authored by Thibaud-Vdb's avatar Thibaud-Vdb
Browse files

Merge branch '625-jest-add-passwithnotests-option-by-default' into 'latest'

Resolve "Jest - Add --passWithNoTests option by default"

Closes #625

See merge request r2devops/hub!389
parents f27cb699 3c619667
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
# Changelog
All notable changes to this job will be documented in this file.

## [1.2.0] - 2022-06-13
* Add --passWithNoTests option with a boolean variable to activate it

## [1.1.1] - 2022-06-13
* Add docker image tag in variable 

+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ On top of rolling your tests for you, it will create you a coverage report
| ---- | ----------- | ------- |
| `PROJECT_ROOT` | Path to the directory containing `package.json`  | `.` |
| `JEST_INCREMENTAL` | Run tests that only are relevant based on last commit changes | `false` |
| `PASS_WITH_NO_TESTS` | If set to true, the job will not fail if no tests are present | `true` |
| `ADDITIONAL_OPTIONS` | Additional options for your `jest` | ` ` |
| `IMAGE_TAG` | The default tag for the docker image | `18.1-alpine3.14`  |

+2 −1
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ jest:
    PROJECT_ROOT: "."
    JEST_INCREMENTAL: "false"
    ADDITIONAL_OPTIONS: ""
    PASS_WITH_NO_TESTS: "true"
    IMAGE_TAG: "18.1-alpine3.14"
  script:
    - cd ${CI_PROJECT_DIR}/${PROJECT_ROOT}
@@ -20,7 +21,7 @@ jest:
        npm install --save-dev jest-junit
      fi

    - npm run test -- --coverage --ci --reporters=default --reporters=jest-junit --lastCommit=${JEST_INCREMENTAL} ${ADDITIONAL_OPTIONS}
    - npm run test -- --coverage --ci --reporters=default --reporters=jest-junit --passWithNoTests=${PASS_WITH_NO_TESTS} --lastCommit=${JEST_INCREMENTAL} ${ADDITIONAL_OPTIONS}
  coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/
  artifacts:
    when: always