Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mocha): add support for extra reporters #1182

Merged
merged 7 commits into from
Nov 1, 2024
Merged

Conversation

delatrie
Copy link
Collaborator

@delatrie delatrie commented Oct 31, 2024

Context

The PR makes it possible to enable additional reporters to run alongside Allure Mocha.

Examples

The feature is controlled by a new configuration property:extraReporters. Its values may take the following forms:

  • A string:

    { extraReporters: "json" }

    This is usable from the CLI or config files:

    npx mocha -R allure-mocha -O extraReporters=json

    .mocharc.json:

    {
      "reporter": "allure-mocha",
      "reporterOptions": [
        "extraReporters=json"
      ],
    }
  • An array of one or two elements, where the second element (if present) is an options object:

    { extraReporters: ["json", { output: "output.json" }] }
  • An array of elements, each taking one of the above forms:

    {
      extraReporters: [
        ["json", {output: "output.json"}],
        "mochawesome",
      ],
    }

Closes #1134.

Checklist

@delatrie delatrie added the type:new feature New feature or request label Oct 31, 2024
@github-actions github-actions bot added the theme:mocha Mocha related issue label Oct 31, 2024
@delatrie delatrie marked this pull request as ready for review October 31, 2024 15:42
@delatrie delatrie changed the title feat(mocha): extra reporters feat(mocha): add support for extra reporters Oct 31, 2024
@baev baev merged commit a84cc84 into main Nov 1, 2024
12 checks passed
@baev baev deleted the mocha-multi-reporters branch November 1, 2024 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:mocha Mocha related issue type:new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mocha-allure v3.0.0-beta.10 isn't compatible with mocha-multi-reporters in parallel mode
2 participants