Registry /
testing / cypress-circleci-reporter
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Reporter Configuration String
✓ module.exports = defineConfig({
e2e: {
reporter: 'cypress-circleci-reporter',
reporterOptions: {
resultsDir: './test_results/cypress',
resultFileName: 'cypress-[hash].xml'
}
}
});
✗ import { CypressCircleciReporter } from 'cypress-circleci-reporter';
The reporter is primarily configured as a string literal in `cypress.config.js` or `cypress.json`.
CLI Reporter Flag
✓ cypress run --reporter cypress-circleci-reporter --reporter-options "resultsDir=./results/cypress,resultFileName=report-[hash].xml"
✗ cypress run --reporter require('cypress-circleci-reporter')
When running Cypress via the command line, the reporter is specified using the `--reporter` flag. Reporter options are passed via `--reporter-options` as a comma-separated string.
ReporterOptions (TypeScript Type)
✓ import { ReporterOptions } from 'cypress-circleci-reporter';
✗ import ReporterOptions from 'cypress-circleci-reporter';
For TypeScript projects, the `ReporterOptions` interface can be imported to type custom configuration objects.
This quickstart demonstrates how to configure `cypress-circleci-reporter` within `cypress.config.ts` and shows a typical CircleCI `config.yml` setup for parallel test execution.
import { defineConfig } from 'cypress';
module.exports = defineConfig({
e2e: {
// Configure the reporter and its options
reporter: 'cypress-circleci-reporter',
reporterOptions: {
project: process.env.CYPRESS_PROJECT_NAME ?? undefined, // Optional: if you use Cypress' project parameter
resultsDir: './test_results/cypress', // Directory for JUnit XML reports
resultFileName: 'cypress-[hash].xml', // Filename for each report, [hash] is crucial for uniqueness
consoleOutput: true // Enable console output for test results
},
// Implement node event listeners if needed (e.g., for code coverage, though not direct reporter usage)
setupNodeEvents(on, config) {
// This is where you might include other Cypress plugins if necessary
// For cypress-circleci-reporter, primary setup is through the 'reporter' key above.
return config;
}
}
});
// In your package.json scripts:
// "scripts": {
// "cypress:ci": "yarn cypress run --spec \"$(circleci tests glob \"./cypress/e2e/**/*.cy.js\" | circleci tests split --split-by=timings | paste -sd \",\" -)\" --reporter cypress-circleci-reporter"
// }
// Example CircleCI config snippet:
// run_cypress_tests:
// parallelism: 3
// steps:
// - run:
// name: Run cypress tests
// command: |
// yarn cypress run --spec "$(circleci tests glob "./cypress/e2e/**/*.cy.js" | circleci tests split --split-by=timings | paste -sd "," -)" \
// --reporter cypress-circleci-reporter \
// --reporter-options "resultsDir=./test_results/cypress,resultFileName=cypress-[hash].xml,consoleOutput=true"
// - store_test_results:
// path: test_results
// - store_artifacts:
// path: test_results
Errors
Common errors & fixes
Error: Cannot find module 'mocha'
The `mocha` package is a peer dependency but was not installed in your project.
fixRun `npm install mocha --save-dev` or `yarn add mocha --dev` to install the `mocha` test framework.
Error: Reporter "cypress-circleci-reporter" not found.
The reporter package is either not installed, misspelled in the configuration, or Cypress cannot resolve its path.
fixVerify the package name is correctly spelled in your `cypress.config.js` or CLI command, and ensure `npm install cypress-circleci-reporter` was run successfully.
Invalid reporter option 'resultFileName': Must include '[hash]' placeholder.
The `resultFileName` option was provided without the mandatory `[hash]` string, which is required for generating unique report filenames.
fixModify your `reporterOptions` to include `resultFileName: 'my-report-[hash].xml'` (or similar) to ensure unique filenames.
Audit
Dependencies
mocharequiredPeer dependency required by the reporter for its underlying functionality.