diff --git a/packages/third-party-reporter/README.md b/packages/third-party-reporter/README.md index 3126b17..b4fa25e 100644 --- a/packages/third-party-reporter/README.md +++ b/packages/third-party-reporter/README.md @@ -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`. diff --git a/packages/third-party-reporter/index.js b/packages/third-party-reporter/index.js deleted file mode 100644 index e62582b..0000000 --- a/packages/third-party-reporter/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./lib/my-reporter.js'); diff --git a/packages/third-party-reporter/test/unit/my-reporter.spec.js b/packages/third-party-reporter/test/unit/my-reporter.spec.js index 54f1df1..7fe7ba6 100644 --- a/packages/third-party-reporter/test/unit/my-reporter.spec.js +++ b/packages/third-party-reporter/test/unit/my-reporter.spec.js @@ -4,4 +4,8 @@ describe('Third party reporter usage', () => { it('should equal true', () => { equal(true, true); }); + + it('should fail', () => { + equal(true, false); + }) });