Commit 6d638688 authored by Mathis Goichon's avatar Mathis Goichon
Browse files

fix(jest): junit_test_report as file name instead of unit_test_report

parent 3da63e01
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ This job is bound to the `build` stage, and uses the following variables:
| `NODE_BUILD_ARGS`             | npm [run script](https://docs.npmjs.com/cli/v8/commands/npm-run-script) arguments <br/> yarn [run script](https://classic.yarnpkg.com/en/docs/cli/run) arguments  | `run build --prod`              |
| `NODE_TEST_ARGS`              | npm [test](https://docs.npmjs.com/cli/v8/commands/npm-test) arguments <br/> yarn [test](https://classic.yarnpkg.com/en/docs/cli/test) arguments                   | `test -- --coverage --bail`     |

The job generates a unit test report that you will find here: `NODE_PROJECT_DIR/reports/unit_test_report.xml`.
The job generates a unit test report that you will find here: `NODE_PROJECT_DIR/reports/junit_test_report.xml`.

#### Unit testing with Jest

@@ -183,7 +183,7 @@ Then update your `package.json` as follows:
```js
"scripts": {
  "test": "npm run mocha",
  "mocha": "nyc mocha app/tests/*.test.js --reporter spec --reporter mocha-junit-reporter --reporter-options mochaFile=./reports/unit_test_report.xml",
  "mocha": "nyc mocha app/tests/*.test.js --reporter spec --reporter mocha-junit-reporter --reporter-options mochaFile=./reports/junit_test_report.xml",
}
```

+1 −1
Original line number Diff line number Diff line
@@ -296,7 +296,7 @@ node-build:
  coverage: '/^All files\s*\|\s*(\d+(?:\.\d+)?)/'
  artifacts:
    reports:
      junit: $NODE_PROJECT_DIR/reports/unit_test_report.xml
      junit: $NODE_PROJECT_DIR/reports/junit_test_report.xml
    when: always
    name: "$CI_JOB_NAME artifacts from $CI_PROJECT_NAME on $CI_COMMIT_REF_SLUG"
    paths: