{
  "doc": {
    "id": "app/tooling/reporters",
    "title": "Built-in and Custom Reporters in Cypress: Setup Guide",
    "description": "Learn how to use custom reporters in Cypress to output test results in different formats.",
    "section": "app",
    "source_path": "/llm/markdown/app/tooling/reporters.md",
    "version": "e6988a974973e9090ce70406c38cb2b9e0eac9fa",
    "updated_at": "2026-05-15T15:50:22.536Z",
    "headings": [
      {
        "id": "app/tooling/reporters#reporters-in-cypress",
        "text": "Reporters in Cypress",
        "level": 1
      },
      {
        "id": "app/tooling/reporters#what-youll-learn",
        "text": "What you'll learn",
        "level": 5
      },
      {
        "id": "app/tooling/reporters#introduction",
        "text": "Introduction",
        "level": 2
      },
      {
        "id": "app/tooling/reporters#built-in-reporters",
        "text": "Built in reporters",
        "level": 2
      },
      {
        "id": "app/tooling/reporters#custom-reporters",
        "text": "Custom reporters",
        "level": 2
      },
      {
        "id": "app/tooling/reporters#installed-locally",
        "text": "Installed locally",
        "level": 3
      },
      {
        "id": "app/tooling/reporters#cypress-configuration",
        "text": "Cypress configuration",
        "level": 4
      },
      {
        "id": "app/tooling/reporters#command-line",
        "text": "Command Line",
        "level": 4
      },
      {
        "id": "app/tooling/reporters#installed-via-npm",
        "text": "Installed via npm",
        "level": 3
      },
      {
        "id": "app/tooling/reporters#cypress-configuration",
        "text": "Cypress configuration",
        "level": 4
      },
      {
        "id": "app/tooling/reporters#command-line",
        "text": "Command line",
        "level": 4
      },
      {
        "id": "app/tooling/reporters#reporter-options",
        "text": "Reporter Options",
        "level": 2
      },
      {
        "id": "app/tooling/reporters#cypress-configuration",
        "text": "Cypress configuration",
        "level": 3
      },
      {
        "id": "app/tooling/reporters#command-line",
        "text": "Command line",
        "level": 3
      },
      {
        "id": "app/tooling/reporters#merging-reports-across-spec-files",
        "text": "Merging reports across spec files",
        "level": 2
      },
      {
        "id": "app/tooling/reporters#cypress-configuration",
        "text": "Cypress configuration",
        "level": 4
      },
      {
        "id": "app/tooling/reporters#command-line",
        "text": "Command line",
        "level": 4
      },
      {
        "id": "app/tooling/reporters#multiple-reporters",
        "text": "Multiple reporters",
        "level": 2
      },
      {
        "id": "app/tooling/reporters#examples",
        "text": "Examples",
        "level": 3
      },
      {
        "id": "app/tooling/reporters#spec-to-stdout-save-junit-xml-files",
        "text": "Spec to STDOUT, save JUnit XML files",
        "level": 4
      },
      {
        "id": "app/tooling/reporters#cypress-configuration",
        "text": "Cypress configuration",
        "level": 4
      },
      {
        "id": "app/tooling/reporters#command-line",
        "text": "Command line",
        "level": 4
      },
      {
        "id": "app/tooling/reporters#spec-to-stdout-produce-a-combined-mochawesome-json-file",
        "text": "Spec to STDOUT, produce a combined Mochawesome JSON file",
        "level": 4
      },
      {
        "id": "app/tooling/reporters#cypress-configuration",
        "text": "Cypress configuration",
        "level": 4
      },
      {
        "id": "app/tooling/reporters#command-line",
        "text": "Command line",
        "level": 4
      },
      {
        "id": "app/tooling/reporters#history",
        "text": "History",
        "level": 2
      }
    ]
  },
  "chunks": [
    {
      "id": "app/tooling/reporters#introduction",
      "doc_id": "app/tooling/reporters",
      "heading": "Introduction",
      "heading_level": 2,
      "content_markdown": "## Introduction\n\nAfter writing and running tests in Cypress, reviewing the results of those tests is crucial. Cypress provides several options to review results of a test run.\n\n*   [Cypress Cloud](/llm/markdown/cloud/get-started/introduction.md) - See test results, spec data, errors, screenshots, videos, and Test Replay in Cypress Cloud.\n*   Cypress App's open source built in and custom reporters.\n\nThis document covers how to use [built in](#Built-in-reporters) and [custom](#Custom-reporters) reporters in Cypress App.\n\nTo get started with Cypress Cloud, [sign up](https://cloud.cypress.io/signup) to start your **30 day free trial** - including all premium Cypress Cloud features and plenty of test results to let you experience the power of Cypress Cloud!\n",
      "section": "app",
      "anchors": [
        "introduction"
      ],
      "path": "/llm/json/chunked/app/tooling/reporters.json",
      "token_estimate": 141
    },
    {
      "id": "app/tooling/reporters#built-in-reporters",
      "doc_id": "app/tooling/reporters",
      "heading": "Built in reporters",
      "heading_level": 2,
      "content_markdown": "## Built in reporters\n\nBecause Cypress is built on top of Mocha, that means any reporter built for Mocha can be used with Cypress. Here is a list of built in Mocha reporters.\n\n*   [Mocha's built-in reporters](https://mochajs.org/#reporters)\n\nBy default, Cypress uses the `spec` reporter to output information to `STDOUT`.\n\nWe've also added the two most common 3rd party reporters for Mocha. These are built into Cypress and you can use them without installing anything.\n\n*   [`teamcity`](https://github.com/travisjeffery/mocha-teamcity-reporter)\n*   [`junit`](https://github.com/michaelleeallen/mocha-junit-reporter)\n",
      "section": "app",
      "anchors": [
        "built-in-reporters"
      ],
      "path": "/llm/json/chunked/app/tooling/reporters.json",
      "token_estimate": 104
    },
    {
      "id": "app/tooling/reporters#custom-reporters",
      "doc_id": "app/tooling/reporters",
      "heading": "Custom reporters",
      "heading_level": 2,
      "content_markdown": "## Custom reporters\n\nCypress supports creating your own custom reporters or using any kind of 3rd party reporter.\n\n### Installed locally\n\nYou can load [custom Mocha reporters](https://mochajs.org/api/tutorial-custom-reporter.html) through a relative or absolute path. These can be specified in your Cypress configuration file or via the [command line](/llm/markdown/app/references/command-line.md).\n\nFor example, if you have the following directory structure:\n\n```\n> my-project  > cypress  > src  > reporters    - custom.js\n```\n\nYou would specify the path to your custom reporter in either of the ways below.\n\n#### Cypress configuration\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  reporter: 'reporters/custom.js',})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  reporter: 'reporters/custom.js',})\n```\n\n#### Command Line\n\n```\nnpx cypress run --reporter reporters/custom.js\n```\n\n### Installed via npm\n\nWhen using custom reporters via npm, specify the package name.\n\n#### Cypress configuration\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  reporter: 'mochawesome',})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  reporter: 'mochawesome',})\n```\n\n#### Command line\n\n```\nnpx cypress run --reporter mochawesome\n```\n",
      "section": "app",
      "anchors": [
        "custom-reporters"
      ],
      "path": "/llm/json/chunked/app/tooling/reporters.json",
      "token_estimate": 239
    },
    {
      "id": "app/tooling/reporters#installed-locally",
      "doc_id": "app/tooling/reporters",
      "heading": "Installed locally",
      "heading_level": 3,
      "content_markdown": "### Installed locally\n\nYou can load [custom Mocha reporters](https://mochajs.org/api/tutorial-custom-reporter.html) through a relative or absolute path. These can be specified in your Cypress configuration file or via the [command line](/llm/markdown/app/references/command-line.md).\n\nFor example, if you have the following directory structure:\n\n```\n> my-project  > cypress  > src  > reporters    - custom.js\n```\n\nYou would specify the path to your custom reporter in either of the ways below.\n\n#### Cypress configuration\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  reporter: 'reporters/custom.js',})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  reporter: 'reporters/custom.js',})\n```\n\n#### Command Line\n\n```\nnpx cypress run --reporter reporters/custom.js\n```\n",
      "section": "app",
      "anchors": [
        "installed-locally"
      ],
      "path": "/llm/json/chunked/app/tooling/reporters.json",
      "token_estimate": 141
    },
    {
      "id": "app/tooling/reporters#cypress-configuration",
      "doc_id": "app/tooling/reporters",
      "heading": "Cypress configuration",
      "heading_level": 4,
      "content_markdown": "#### Cypress configuration\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  reporter: 'reporters/custom.js',})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  reporter: 'reporters/custom.js',})\n```\n",
      "section": "app",
      "anchors": [
        "cypress-configuration"
      ],
      "path": "/llm/json/chunked/app/tooling/reporters.json",
      "token_estimate": 41
    },
    {
      "id": "app/tooling/reporters#installed-via-npm",
      "doc_id": "app/tooling/reporters",
      "heading": "Installed via npm",
      "heading_level": 3,
      "content_markdown": "### Installed via npm\n\nWhen using custom reporters via npm, specify the package name.\n\n#### Cypress configuration\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  reporter: 'mochawesome',})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  reporter: 'mochawesome',})\n```\n\n#### Command line\n\n```\nnpx cypress run --reporter mochawesome\n```\n",
      "section": "app",
      "anchors": [
        "installed-via-npm"
      ],
      "path": "/llm/json/chunked/app/tooling/reporters.json",
      "token_estimate": 73
    },
    {
      "id": "app/tooling/reporters#cypress-configuration",
      "doc_id": "app/tooling/reporters",
      "heading": "Cypress configuration",
      "heading_level": 4,
      "content_markdown": "#### Cypress configuration\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  reporter: 'mochawesome',})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  reporter: 'mochawesome',})\n```\n",
      "section": "app",
      "anchors": [
        "cypress-configuration"
      ],
      "path": "/llm/json/chunked/app/tooling/reporters.json",
      "token_estimate": 41
    },
    {
      "id": "app/tooling/reporters#reporter-options",
      "doc_id": "app/tooling/reporters",
      "heading": "Reporter Options",
      "heading_level": 2,
      "content_markdown": "## Reporter Options\n\nSome reporters accept options that customize their behavior. These can be specified in your Cypress configuration or via [command line](/llm/markdown/app/references/command-line.md) options.\n\nReporter options differ depending on the reporter (and may not be supported at all). Refer to the documentation for the reporter you are using for details on which options are supported.\n\nThe below configuration will output the JUnit report to `STDOUT` and save it into an XML file.\n\n### Cypress configuration\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  reporter: 'junit',  reporterOptions: {    mochaFile: 'results/my-test-output.xml',    toConsole: true,  },})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  reporter: 'junit',  reporterOptions: {    mochaFile: 'results/my-test-output.xml',    toConsole: true,  },})\n```\n\n### Command line\n\n```\nnpx cypress run --reporter junit \\  --reporter-options \"mochaFile=results/my-test-output.xml,toConsole=true\"\n```\n",
      "section": "app",
      "anchors": [
        "reporter-options"
      ],
      "path": "/llm/json/chunked/app/tooling/reporters.json",
      "token_estimate": 173
    },
    {
      "id": "app/tooling/reporters#cypress-configuration",
      "doc_id": "app/tooling/reporters",
      "heading": "Cypress configuration",
      "heading_level": 3,
      "content_markdown": "### Cypress configuration\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  reporter: 'junit',  reporterOptions: {    mochaFile: 'results/my-test-output.xml',    toConsole: true,  },})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  reporter: 'junit',  reporterOptions: {    mochaFile: 'results/my-test-output.xml',    toConsole: true,  },})\n```\n",
      "section": "app",
      "anchors": [
        "cypress-configuration"
      ],
      "path": "/llm/json/chunked/app/tooling/reporters.json",
      "token_estimate": 60
    },
    {
      "id": "app/tooling/reporters#merging-reports-across-spec-files",
      "doc_id": "app/tooling/reporters",
      "heading": "Merging reports across spec files",
      "heading_level": 2,
      "content_markdown": "## Merging reports across spec files\n\nEach spec file is processed completely separately during each `cypress run` execution. Thus each spec run _overwrites_ the previous report file. To preserve unique reports for each specfile, use the `[hash]` in the `mochaFile` filename.\n\nThe following configuration will create separate XML files in the `results` folder. You can then merge the reported output in a separate step using a 3rd party tool. For example, for the [Mochawesome](https://github.com/adamgruber/mochawesome) reporter, you can use the [mochawesome-merge](https://github.com/antontelesh/mochawesome-merge) tool.\n\n#### Cypress configuration\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  reporter: 'junit',  reporterOptions: {    mochaFile: 'results/my-test-output-[hash].xml',  },})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  reporter: 'junit',  reporterOptions: {    mochaFile: 'results/my-test-output-[hash].xml',  },})\n```\n\n#### Command line\n\n```\nnpx cypress run --reporter junit \\  --reporter-options \"mochaFile=results/my-test-output-[hash].xml\"\n```\n",
      "section": "app",
      "anchors": [
        "merging-reports-across-spec-files"
      ],
      "path": "/llm/json/chunked/app/tooling/reporters.json",
      "token_estimate": 180
    },
    {
      "id": "app/tooling/reporters#cypress-configuration",
      "doc_id": "app/tooling/reporters",
      "heading": "Cypress configuration",
      "heading_level": 4,
      "content_markdown": "#### Cypress configuration\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  reporter: 'junit',  reporterOptions: {    mochaFile: 'results/my-test-output-[hash].xml',  },})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  reporter: 'junit',  reporterOptions: {    mochaFile: 'results/my-test-output-[hash].xml',  },})\n```\n",
      "section": "app",
      "anchors": [
        "cypress-configuration"
      ],
      "path": "/llm/json/chunked/app/tooling/reporters.json",
      "token_estimate": 55
    },
    {
      "id": "app/tooling/reporters#multiple-reporters",
      "doc_id": "app/tooling/reporters",
      "heading": "Multiple reporters",
      "heading_level": 2,
      "content_markdown": "## Multiple reporters\n\nOftentimes we see users wanting the ability to use multiple reporters. When running in CI, you might want to generate a report for `junit` and perhaps a `json` report. This is great, but by setting this reporter you won't receive any additional feedback while the tests are running!\n\nThe solution here is to use multiple reporters. You will have the benefit of both worlds.\n\nWe suggest using the npm module [cypress-multi-reporters](https://www.npmjs.com/package/cypress-multi-reporters).\n\n### Examples\n\n#### Spec to `STDOUT`, save JUnit XML files\n\nWe want to output a `spec` report to `STDOUT`, while saving a JUnit XML file for each spec file.\n\nWe need to install additional dependencies:\n\n*   [`cypress-multi-reporters`](https://github.com/YOU54F/cypress-plugins/tree/master/cypress-multi-reporters): enables multiple reporters\n*   [`mocha-junit-reporter`](https://github.com/michaelleeallen/mocha-junit-reporter) the actual junit reporter, as we cannot use the `junit` reporter that comes with Cypress\n\n```\nnpm install cypress-multi-reporters mocha-junit-reporter --save-dev\n```\n\nSpecify your reporter and reporterOptions in your Cypress configuration or via the [command line](/llm/markdown/app/references/command-line.md).\n\n#### Cypress configuration\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  reporter: 'cypress-multi-reporters',  reporterOptions: {    configFile: 'reporter-config.json',  },})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  reporter: 'cypress-multi-reporters',  reporterOptions: {    configFile: 'reporter-config.json',  },})\n```\n\n#### Command line\n\n```\nnpx cypress run --reporter cypress-multi-reporters \\  --reporter-options configFile=reporter-config.json\n```\n\nThen add the separate `reporter-config.json` file (defined in your configuration) to enable `spec` and `junit` reporters and direct the `junit` reporter to save separate XML files.\n\nreporter-config.json\n\n```\n{  \"reporterEnabled\": \"spec, mocha-junit-reporter\",  \"mochaJunitReporterReporterOptions\": {    \"mochaFile\": \"cypress/results/results-[hash].xml\"  }}\n```\n\nWe recommend deleting all files from the `cypress/results` folder before running this command, since each run will output new XML files. For example, you can add the npm script commands below to your `package.json` then call `npm run report`.\n\npackage.json\n\n```\n{  \"scripts\": {    \"delete:reports\": \"rm cypress/results/* || true\",    \"prereport\": \"npm run delete:reports\",    \"report\": \"cypress run --reporter cypress-multi-reporters --reporter-options configFile=reporter-config.json\"  }}\n```\n\nIn case you want to combine generated XML files into a single one, [junit-report-merger](https://www.npmjs.com/package/junit-report-merger) can be added. For example, to combine all files into `cypress/results/combined-report.xml` the `combine:reports` script can be added.\n\npackage.json\n\n```\n{  \"scripts\": {    \"delete:reports\": \"rm cypress/results/* || true\",    \"combine:reports\": \"jrm cypress/results/combined-report.xml \\\"cypress/results/*.xml\\\"\",    \"prereport\": \"npm run delete:reports\",    \"report\": \"cypress run --reporter cypress-multi-reporters --reporter-options configFile=reporter-config.json\",    \"postreport\": \"npm run combine:reports\"  }}\n```\n\n#### Spec to `STDOUT`, produce a combined Mochawesome JSON file\n\nThis example is shown in the branch `spec-and-single-mochawesome-json` in [https://github.com/cypress-io/cypress-example-circleci-orb](https://github.com/cypress-io/cypress-example-circleci-orb). We want to output a \"spec\" report to `STDOUT`, save an individual Mochawesome JSON file per test file, and then combine all JSON reports into a single report.\n\nWe need to install some additional dependencies.\n\n```\nnpm install mochawesome mochawesome-merge mochawesome-report-generator --save-dev\n```\n\nWe need to configure the reporter in your [Cypress configuration](/llm/markdown/app/references/configuration.md) to skip the HTML report generation and save each individual JSON file in the `cypress/results` folder.\n\n#### Cypress configuration\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  reporter: 'mochawesome',  reporterOptions: {    reportDir: 'cypress/results',    overwrite: false,    html: false,    json: true,  },})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  reporter: 'mochawesome',  reporterOptions: {    reportDir: 'cypress/results',    overwrite: false,    html: false,    json: true,  },})\n```\n\n#### Command line\n\n```\nnpx cypress run --reporter mochawesome \\  --reporter-options reportDir=\"cypress/results\",overwrite=false,html=false,json=true\n```\n\nOur run will generate files `cypress/results/mochawesome.json, cypress/results/mochawesome_001.json, ...`. Then we can combine them using the [mochawesome-merge](https://github.com/antontelesh/mochawesome-merge) utility.\n\n```\nnpx mochawesome-merge \"cypress/results/*.json\" > mochawesome.json\n```\n\nWe can now generate a combined HTML report from the `mochawesome.json` file using the [https://github.com/adamgruber/mochawesome-report-generator](https://github.com/adamgruber/mochawesome-report-generator):\n\n```\nnpx marge mochawesome.json\n```\n\nIt generates the beautiful standalone HTML report file `mochawesome-report/mochawesome.html` shown below. As you can see all test results, timing information, and even test bodies are included.\n\nFor more information, see [Integrating Mochawesome reporter with Cypress's](http://antontelesh.github.io/testing/2019/02/04/mochawesome-merge.html)\n",
      "section": "app",
      "anchors": [
        "multiple-reporters"
      ],
      "path": "/llm/json/chunked/app/tooling/reporters.json",
      "token_estimate": 803
    },
    {
      "id": "app/tooling/reporters#examples",
      "doc_id": "app/tooling/reporters",
      "heading": "Examples",
      "heading_level": 3,
      "content_markdown": "### Examples\n\n#### Spec to `STDOUT`, save JUnit XML files\n\nWe want to output a `spec` report to `STDOUT`, while saving a JUnit XML file for each spec file.\n\nWe need to install additional dependencies:\n\n*   [`cypress-multi-reporters`](https://github.com/YOU54F/cypress-plugins/tree/master/cypress-multi-reporters): enables multiple reporters\n*   [`mocha-junit-reporter`](https://github.com/michaelleeallen/mocha-junit-reporter) the actual junit reporter, as we cannot use the `junit` reporter that comes with Cypress\n\n```\nnpm install cypress-multi-reporters mocha-junit-reporter --save-dev\n```\n\nSpecify your reporter and reporterOptions in your Cypress configuration or via the [command line](/llm/markdown/app/references/command-line.md).\n\n#### Cypress configuration\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  reporter: 'cypress-multi-reporters',  reporterOptions: {    configFile: 'reporter-config.json',  },})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  reporter: 'cypress-multi-reporters',  reporterOptions: {    configFile: 'reporter-config.json',  },})\n```\n\n#### Command line\n\n```\nnpx cypress run --reporter cypress-multi-reporters \\  --reporter-options configFile=reporter-config.json\n```\n\nThen add the separate `reporter-config.json` file (defined in your configuration) to enable `spec` and `junit` reporters and direct the `junit` reporter to save separate XML files.\n\nreporter-config.json\n\n```\n{  \"reporterEnabled\": \"spec, mocha-junit-reporter\",  \"mochaJunitReporterReporterOptions\": {    \"mochaFile\": \"cypress/results/results-[hash].xml\"  }}\n```\n\nWe recommend deleting all files from the `cypress/results` folder before running this command, since each run will output new XML files. For example, you can add the npm script commands below to your `package.json` then call `npm run report`.\n\npackage.json\n\n```\n{  \"scripts\": {    \"delete:reports\": \"rm cypress/results/* || true\",    \"prereport\": \"npm run delete:reports\",    \"report\": \"cypress run --reporter cypress-multi-reporters --reporter-options configFile=reporter-config.json\"  }}\n```\n\nIn case you want to combine generated XML files into a single one, [junit-report-merger](https://www.npmjs.com/package/junit-report-merger) can be added. For example, to combine all files into `cypress/results/combined-report.xml` the `combine:reports` script can be added.\n\npackage.json\n\n```\n{  \"scripts\": {    \"delete:reports\": \"rm cypress/results/* || true\",    \"combine:reports\": \"jrm cypress/results/combined-report.xml \\\"cypress/results/*.xml\\\"\",    \"prereport\": \"npm run delete:reports\",    \"report\": \"cypress run --reporter cypress-multi-reporters --reporter-options configFile=reporter-config.json\",    \"postreport\": \"npm run combine:reports\"  }}\n```\n\n#### Spec to `STDOUT`, produce a combined Mochawesome JSON file\n\nThis example is shown in the branch `spec-and-single-mochawesome-json` in [https://github.com/cypress-io/cypress-example-circleci-orb](https://github.com/cypress-io/cypress-example-circleci-orb). We want to output a \"spec\" report to `STDOUT`, save an individual Mochawesome JSON file per test file, and then combine all JSON reports into a single report.\n\nWe need to install some additional dependencies.\n\n```\nnpm install mochawesome mochawesome-merge mochawesome-report-generator --save-dev\n```\n\nWe need to configure the reporter in your [Cypress configuration](/llm/markdown/app/references/configuration.md) to skip the HTML report generation and save each individual JSON file in the `cypress/results` folder.\n\n#### Cypress configuration\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  reporter: 'mochawesome',  reporterOptions: {    reportDir: 'cypress/results',    overwrite: false,    html: false,    json: true,  },})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  reporter: 'mochawesome',  reporterOptions: {    reportDir: 'cypress/results',    overwrite: false,    html: false,    json: true,  },})\n```\n\n#### Command line\n\n```\nnpx cypress run --reporter mochawesome \\  --reporter-options reportDir=\"cypress/results\",overwrite=false,html=false,json=true\n```\n\nOur run will generate files `cypress/results/mochawesome.json, cypress/results/mochawesome_001.json, ...`. Then we can combine them using the [mochawesome-merge](https://github.com/antontelesh/mochawesome-merge) utility.\n\n```\nnpx mochawesome-merge \"cypress/results/*.json\" > mochawesome.json\n```\n\nWe can now generate a combined HTML report from the `mochawesome.json` file using the [https://github.com/adamgruber/mochawesome-report-generator](https://github.com/adamgruber/mochawesome-report-generator):\n\n```\nnpx marge mochawesome.json\n```\n\nIt generates the beautiful standalone HTML report file `mochawesome-report/mochawesome.html` shown below. As you can see all test results, timing information, and even test bodies are included.\n\nFor more information, see [Integrating Mochawesome reporter with Cypress's](http://antontelesh.github.io/testing/2019/02/04/mochawesome-merge.html)\n",
      "section": "app",
      "anchors": [
        "examples"
      ],
      "path": "/llm/json/chunked/app/tooling/reporters.json",
      "token_estimate": 704
    },
    {
      "id": "app/tooling/reporters#spec-to-stdout-save-junit-xml-files",
      "doc_id": "app/tooling/reporters",
      "heading": "Spec to STDOUT, save JUnit XML files",
      "heading_level": 4,
      "content_markdown": "#### Spec to `STDOUT`, save JUnit XML files\n\nWe want to output a `spec` report to `STDOUT`, while saving a JUnit XML file for each spec file.\n\nWe need to install additional dependencies:\n\n*   [`cypress-multi-reporters`](https://github.com/YOU54F/cypress-plugins/tree/master/cypress-multi-reporters): enables multiple reporters\n*   [`mocha-junit-reporter`](https://github.com/michaelleeallen/mocha-junit-reporter) the actual junit reporter, as we cannot use the `junit` reporter that comes with Cypress\n\n```\nnpm install cypress-multi-reporters mocha-junit-reporter --save-dev\n```\n\nSpecify your reporter and reporterOptions in your Cypress configuration or via the [command line](/llm/markdown/app/references/command-line.md).\n",
      "section": "app",
      "anchors": [
        "spec-to-stdout-save-junit-xml-files"
      ],
      "path": "/llm/json/chunked/app/tooling/reporters.json",
      "token_estimate": 101
    },
    {
      "id": "app/tooling/reporters#cypress-configuration",
      "doc_id": "app/tooling/reporters",
      "heading": "Cypress configuration",
      "heading_level": 4,
      "content_markdown": "#### Cypress configuration\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  reporter: 'cypress-multi-reporters',  reporterOptions: {    configFile: 'reporter-config.json',  },})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  reporter: 'cypress-multi-reporters',  reporterOptions: {    configFile: 'reporter-config.json',  },})\n```\n",
      "section": "app",
      "anchors": [
        "cypress-configuration"
      ],
      "path": "/llm/json/chunked/app/tooling/reporters.json",
      "token_estimate": 55
    },
    {
      "id": "app/tooling/reporters#command-line",
      "doc_id": "app/tooling/reporters",
      "heading": "Command line",
      "heading_level": 4,
      "content_markdown": "#### Command line\n\n```\nnpx cypress run --reporter cypress-multi-reporters \\  --reporter-options configFile=reporter-config.json\n```\n\nThen add the separate `reporter-config.json` file (defined in your configuration) to enable `spec` and `junit` reporters and direct the `junit` reporter to save separate XML files.\n\nreporter-config.json\n\n```\n{  \"reporterEnabled\": \"spec, mocha-junit-reporter\",  \"mochaJunitReporterReporterOptions\": {    \"mochaFile\": \"cypress/results/results-[hash].xml\"  }}\n```\n\nWe recommend deleting all files from the `cypress/results` folder before running this command, since each run will output new XML files. For example, you can add the npm script commands below to your `package.json` then call `npm run report`.\n\npackage.json\n\n```\n{  \"scripts\": {    \"delete:reports\": \"rm cypress/results/* || true\",    \"prereport\": \"npm run delete:reports\",    \"report\": \"cypress run --reporter cypress-multi-reporters --reporter-options configFile=reporter-config.json\"  }}\n```\n\nIn case you want to combine generated XML files into a single one, [junit-report-merger](https://www.npmjs.com/package/junit-report-merger) can be added. For example, to combine all files into `cypress/results/combined-report.xml` the `combine:reports` script can be added.\n\npackage.json\n\n```\n{  \"scripts\": {    \"delete:reports\": \"rm cypress/results/* || true\",    \"combine:reports\": \"jrm cypress/results/combined-report.xml \\\"cypress/results/*.xml\\\"\",    \"prereport\": \"npm run delete:reports\",    \"report\": \"cypress run --reporter cypress-multi-reporters --reporter-options configFile=reporter-config.json\",    \"postreport\": \"npm run combine:reports\"  }}\n```\n",
      "section": "app",
      "anchors": [
        "command-line"
      ],
      "path": "/llm/json/chunked/app/tooling/reporters.json",
      "token_estimate": 233
    },
    {
      "id": "app/tooling/reporters#spec-to-stdout-produce-a-combined-mochawesome-json-file",
      "doc_id": "app/tooling/reporters",
      "heading": "Spec to STDOUT, produce a combined Mochawesome JSON file",
      "heading_level": 4,
      "content_markdown": "#### Spec to `STDOUT`, produce a combined Mochawesome JSON file\n\nThis example is shown in the branch `spec-and-single-mochawesome-json` in [https://github.com/cypress-io/cypress-example-circleci-orb](https://github.com/cypress-io/cypress-example-circleci-orb). We want to output a \"spec\" report to `STDOUT`, save an individual Mochawesome JSON file per test file, and then combine all JSON reports into a single report.\n\nWe need to install some additional dependencies.\n\n```\nnpm install mochawesome mochawesome-merge mochawesome-report-generator --save-dev\n```\n\nWe need to configure the reporter in your [Cypress configuration](/llm/markdown/app/references/configuration.md) to skip the HTML report generation and save each individual JSON file in the `cypress/results` folder.\n",
      "section": "app",
      "anchors": [
        "spec-to-stdout-produce-a-combined-mochawesome-json-file"
      ],
      "path": "/llm/json/chunked/app/tooling/reporters.json",
      "token_estimate": 119
    },
    {
      "id": "app/tooling/reporters#cypress-configuration",
      "doc_id": "app/tooling/reporters",
      "heading": "Cypress configuration",
      "heading_level": 4,
      "content_markdown": "#### Cypress configuration\n\n*   cypress.config.js\n*   cypress.config.ts\n\n```\nconst { defineConfig } = require('cypress')module.exports = defineConfig({  reporter: 'mochawesome',  reporterOptions: {    reportDir: 'cypress/results',    overwrite: false,    html: false,    json: true,  },})\n```\n\n```\nimport { defineConfig } from 'cypress'export default defineConfig({  reporter: 'mochawesome',  reporterOptions: {    reportDir: 'cypress/results',    overwrite: false,    html: false,    json: true,  },})\n```\n",
      "section": "app",
      "anchors": [
        "cypress-configuration"
      ],
      "path": "/llm/json/chunked/app/tooling/reporters.json",
      "token_estimate": 71
    },
    {
      "id": "app/tooling/reporters#command-line",
      "doc_id": "app/tooling/reporters",
      "heading": "Command line",
      "heading_level": 4,
      "content_markdown": "#### Command line\n\n```\nnpx cypress run --reporter mochawesome \\  --reporter-options reportDir=\"cypress/results\",overwrite=false,html=false,json=true\n```\n\nOur run will generate files `cypress/results/mochawesome.json, cypress/results/mochawesome_001.json, ...`. Then we can combine them using the [mochawesome-merge](https://github.com/antontelesh/mochawesome-merge) utility.\n\n```\nnpx mochawesome-merge \"cypress/results/*.json\" > mochawesome.json\n```\n\nWe can now generate a combined HTML report from the `mochawesome.json` file using the [https://github.com/adamgruber/mochawesome-report-generator](https://github.com/adamgruber/mochawesome-report-generator):\n\n```\nnpx marge mochawesome.json\n```\n\nIt generates the beautiful standalone HTML report file `mochawesome-report/mochawesome.html` shown below. As you can see all test results, timing information, and even test bodies are included.\n\nFor more information, see [Integrating Mochawesome reporter with Cypress's](http://antontelesh.github.io/testing/2019/02/04/mochawesome-merge.html)\n",
      "section": "app",
      "anchors": [
        "command-line"
      ],
      "path": "/llm/json/chunked/app/tooling/reporters.json",
      "token_estimate": 123
    },
    {
      "id": "app/tooling/reporters#history",
      "doc_id": "app/tooling/reporters",
      "heading": "History",
      "heading_level": 2,
      "content_markdown": "## History\n\n| Version | Changes |\n| --- | --- |\n| [4.4.2](/llm/markdown/app/references/changelog.md) | Custom Mocha reporters updated to use the version of Mocha bundled with Cypress. No need to install `mocha` separately to use custom reporters. |\n",
      "section": "app",
      "anchors": [
        "history"
      ],
      "path": "/llm/json/chunked/app/tooling/reporters.json",
      "token_estimate": 52
    }
  ]
}