-
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Improve third-party reporters example (#104)
* Update readme * Remove unused file * Ref .mocharc.json * One reporter, one runner * Add actual failing test * Link to tutorial * Tutorial will cover more details ;)
- Loading branch information
1 parent
16a5f6b
commit 48f723f
Showing
3 changed files
with
11 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
# Third party reporter | ||
# Third-party reporter | ||
|
||
Full documentation about it [here](https://github.com/mochajs/mocha/wiki/Third-party-reporters). | ||
Mocha supports third-party reporters that can support advanced or specific use-cases. A reporter wraps around a [Runner](https://mochajs.org/api/runner) object and optionally listens to the events it emits. | ||
|
||
To use a reporter published on npm (e.g., lcov-reporter), install it locally and set `--reporter lcov-reporter`. | ||
To use a reporter published on npm (e.g., lcov-reporter), install it locally and set `--reporter lcov-reporter`. Alternatively, you can set the reporter in `.mocharc.json` as we've done here. | ||
|
||
It is a very similar setup for `third party UI's`, for more details see [here](https://github.com/mochajs/mocha/wiki/Third-party-UIs). | ||
It is a very similar setup for [third party UI's](https://github.com/mochajs/mocha/wiki/Third-party-UIs). | ||
|
||
## Commands | ||
For more details, including a list of which argument types go with which runner event, see [Tutorial: Create a Custom Reporter](https://mochajs.org/api/tutorial-custom-reporter). | ||
|
||
- `npm test` - run our tests using the local `.mocharc.json` config file. They are run from the default location (`/test`) with the reporter found in `src/my-reporter.js`. In this example there is 1 failing test included, to demonstrate handling. | ||
## Commands | ||
|
||
- `npm test` - run our tests using the local `.mocharc.json` config file. They are run from the default location (`/test`) with the reporter found in `src/my-reporter.js`. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters