Skip to content

📝 Docs: No documentation on third party reporters example #3104

Open

Description

I am attempting to build a custom third party reporter and I am using the simple example presented on this page : https://github.com/mochajs/mocha/wiki/Third-party-reporters. However, I cannot find any wiki or a simple explanation of how everything works.
Questions :

  1. Is the "test" parameter in the runner.on function a .js file containing the tests?
  2. If test is not the file containing the tests, how can I supply one?
  3. How do I run this reporter? Can I do something similar to "mocha testreporter.js" and it would know to check my test files?
  4. How do I include my test reporter in my existing project? Do I need to add it in the package.json? I do not want to publish it on npm, only to use it in my project.

What I am trying to achieve:

-> I need a simple custom test reporter which, based on my tests, can give me back the number of tests which have passed/failed / or a percentage. My plan would be to render my own html based on these results. For this reason, I am not interested in the already existing html test reporters, as I do not want to include error messages etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions