Change docs for mocha-json

mochajs/mocha#4607 has been merged
This commit is contained in:
Daniel Müller 2024-08-06 16:39:58 +02:00 committed by GitHub
parent 9098107e2a
commit c92ced3737
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -310,13 +310,9 @@ Configuration of `uniqueOutputName`, `suiteNameTemplate`, `classNameTemplate`, `
You can use the following example configuration in `package.json`: You can use the following example configuration in `package.json`:
```json ```json
"scripts": { "scripts": {
"test": "mocha --reporter json > test-results.json" "test": "mocha --reporter json --reporter-option output=test-results.json"
} }
``` ```
Test processing might fail if any of your tests write anything on standard output.
Mocha, unfortunately, doesn't have the option to store `json` output directly to the file, and we have to rely on redirecting its standard output.
There is a work in progress to fix it: [mocha#4607](https://github.com/mochajs/mocha/pull/4607)
</details> </details>
<details> <details>