mochawesome vs jest-allure vs mocha-allure-reporter
Test Reporting Solutions for JavaScript Testing Frameworks
mochawesomejest-alluremocha-allure-reporterSimilar Packages:

Test Reporting Solutions for JavaScript Testing Frameworks

jest-allure, mocha-allure-reporter, and mochawesome are npm packages that generate rich, visual test reports from JavaScript test suites. jest-allure integrates Allure reporting into Jest test runs, enabling detailed test metadata like steps, attachments, and severity labels. mocha-allure-reporter provides similar Allure integration but for Mocha-based test suites. mochawesome is a standalone reporter specifically for Mocha that produces self-contained HTML reports with interactive charts, test details, and embedded screenshots — without requiring external tools like the Allure CLI.

Npm Package Weekly Downloads Trend

3 Years

Github Stars Ranking

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
mochawesome1,700,5711,07935.7 kB898 months agoMIT
jest-allure37,43911622.8 kB35-MIT
mocha-allure-reporter04526.1 kB0-Apache-2.0

Test Reporting Deep Dive: jest-allure vs mocha-allure-reporter vs mochawesome

When running automated tests in JavaScript, raw console output isn’t enough for debugging, sharing results, or tracking quality over time. That’s where reporters like jest-allure, mocha-allure-reporter, and mochawesome come in — they transform test outcomes into rich, visual artifacts. But they serve different ecosystems and workflows. Let’s compare them head-to-head.

🧪 Testing Framework Compatibility

Each reporter is tightly coupled to a specific test runner.

jest-allure only works with Jest. It hooks into Jest’s event lifecycle to capture test data.

// jest.config.js
module.exports = {
  reporters: [
    'default',
    ['jest-allure', { outputDirectory: 'allure-results' }]
  ]
};

mocha-allure-reporter only works with Mocha. You must register it via Mocha’s --reporter flag or config.

// .mocharc.js
module.exports = {
  reporter: 'mocha-allure-reporter',
  reporterOptions: {
    resultsDir: 'allure-results'
  }
};

mochawesome also only supports Mocha, but generates its own HTML format.

// .mocharc.js
module.exports = {
  reporter: 'mochawesome',
  reporterOptions: {
    reportDir: 'cypress/reports',
    overwrite: false,
    html: true,
    json: false
  }
};

💡 You cannot use jest-allure with Mocha or mochawesome with Jest — the bindings are framework-specific.

📁 Report Generation Workflow

How you get from test run to readable report differs significantly.

jest-allure and mocha-allure-reporter both produce intermediate JSON/XML files (in allure-results/ by default). To view a human-readable report, you must run the Allure CLI:

# After tests finish
allure serve allure-results
# or
allure generate allure-results && allure open

This adds a build step but enables advanced features like trend analysis and multi-run comparisons.

mochawesome, by contrast, generates a complete HTML file immediately after the test run. No extra tools needed:

# After running Mocha with mochawesome
open mochawesome-report/mochawesome.html

This makes it ideal for quick local feedback or embedding in CI artifacts without post-processing.

🎨 Report Content and Customization

All three let you enrich reports with contextual data, but through different APIs.

Adding Test Steps

With jest-allure, you use the global allure object inside tests:

// Jest test
it('logs in successfully', () => {
  allure.step('Enter username', () => {
    cy.get('#username').type('test');
  });
  allure.step('Submit form', () => {
    cy.get('form').submit();
  });
});

With mocha-allure-reporter, you access Allure via global.allure or import:

// Mocha test
it('logs in successfully', function() {
  const allure = global.allure;
  allure.createStep('Enter username', () => {
    browser.setValue('#username', 'test');
  })();
});

mochawesome doesn’t support nested steps. Instead, you log messages directly to the report using cy.log() (if using Cypress) or by attaching context via this.test:

// Mocha + Cypress
it('logs in successfully', function() {
  cy.get('#username').type('test');
  cy.log('Username entered'); // Appears in report
  cy.get('form').submit();
});

Attaching Screenshots or Files

jest-allure:

allure.attachment('Screenshot', buffer, 'image/png');

mocha-allure-reporter:

allure.addAttachment('Screenshot', buffer, 'image/png');

mochawesome automatically embeds screenshots if you’re using Cypress (via cypress-mochawesome-reporter). In pure Mocha, you’d need to manually write files and reference them — it doesn’t natively support binary attachments.

⚠️ Maintenance and Ecosystem Fit

As of 2023, mocha-allure-reporter is effectively deprecated. Its GitHub repository (https://github.com/allure-framework/mocha-allure-reporter) shows no recent commits, and the official Allure documentation recommends using allure-mocha instead — a newer, more actively maintained package. If starting a new Mocha + Allure project, consider allure-mocha over mocha-allure-reporter.

jest-allure is still maintained but has known limitations with Jest’s modern worker pool architecture, which can cause flaky metadata capture in parallel runs.

mochawesome remains actively developed and is widely used in Cypress-based test suites due to its simplicity and visual clarity.

🌐 Real-World Usage Scenarios

Scenario 1: Enterprise QA Team Using Allure Dashboards

Your company runs Java, Python, and JavaScript tests, all feeding into a centralized Allure dashboard for trend analysis.

  • ✅ Use jest-allure (for Jest) or allure-mocha (not mocha-allure-reporter) for Mocha.
  • ❌ Avoid mochawesome — it doesn’t integrate with Allure’s ecosystem.

Scenario 2: Frontend Team Debugging Cypress Tests Locally

You run end-to-end tests with Cypress (which uses Mocha under the hood) and want immediate, shareable HTML reports after each run.

  • ✅ Use mochawesome with cypress-mochawesome-reporter.
  • ❌ Don’t add Allure unless you really need its features — it’s overkill for local debugging.

Scenario 3: Open-Source Project with Minimal Dependencies

You want beautiful reports but don’t want contributors to install extra CLI tools.

  • mochawesome wins — single HTML file, no external deps.
  • ❌ Allure-based reporters require allure CLI installation.

📊 Summary Table

Featurejest-alluremocha-allure-reportermochawesome
Test RunnerJestMochaMocha
Report FormatAllure (requires CLI)Allure (requires CLI)Self-contained HTML
Steps Support❌ (only flat logs)
Binary Attachments❌ (unless via Cypress)
Zero External Tools
Active Maintenance✅ (with caveats)❌ (use allure-mocha)

💡 Final Recommendation

  • If you’re all-in on Allure for cross-language reporting, pair Jest with jest-allure and Mocha with allure-mocha (not mocha-allure-reporter).
  • If you want simple, immediate, beautiful reports for Mocha/Cypress with no extra setup, mochawesome is the clear winner.
  • Never start a new project with mocha-allure-reporter — it’s outdated and superseded by better alternatives.

Choose based on your team’s toolchain maturity, not just the report’s appearance. A slick HTML file is useless if it doesn’t fit into your CI/CD pipeline or quality metrics strategy.

How to Choose: mochawesome vs jest-allure vs mocha-allure-reporter

  • mochawesome:

    Choose mochawesome if you’re using Mocha and prefer a zero-dependency, self-contained HTML report that works out of the box. It’s excellent for CI pipelines or local debugging where you need immediate, visually clear feedback without extra tooling. However, it doesn’t support Allure-specific features like history or comparison views, and it only works with Mocha.

  • jest-allure:

    Choose jest-allure if you're using Jest and need to integrate with the Allure ecosystem for advanced reporting features like historical trends, environment comparisons, and team-wide dashboards. It’s ideal when your organization already uses Allure or requires its structured metadata model, but be aware it requires installing and running the Allure command-line tool to generate final reports.

  • mocha-allure-reporter:

    Choose mocha-allure-reporter if you’re using Mocha and want to leverage Allure’s reporting capabilities, such as categorized test results, custom labels, and rich attachments. This option makes sense in environments where Allure is standardized across multiple test suites (e.g., combining Java and JavaScript tests), but note that it also depends on the Allure CLI for report generation and is not actively maintained as of 2023.

README for mochawesome

mochawesome

npm Node.js CI Gitter

Mochawesome is a custom reporter for use with the Javascript testing framework, mocha. It runs on Node.js (>=10) and works in conjunction with mochawesome-report-generator to generate a standalone HTML/CSS report to help visualize your test runs.

Features

Mochawesome Report
  • Simple, clean, and modern design
  • Beautiful charts (via ChartJS)
  • Support for test and suite nesting
  • Displays before and after hooks
  • Review test code inline
  • Stack trace for failed tests
  • Support for adding context information to tests
  • Filters to display only the tests you want
  • Responsive and mobile-friendly
  • Offline viewing
  • Supports parallel mode

Usage

  1. Add Mochawesome to your project:

npm install --save-dev mochawesome

  1. Tell mocha to use the Mochawesome reporter:

mocha testfile.js --reporter mochawesome

  1. If using mocha programatically:
var mocha = new Mocha({
  reporter: 'mochawesome',
});

Parallel Mode

Since mocha@8 test files can be run in parallel using the --parallel flag. In order for mochawesome to work properly it needs to be registered as a hook.

mocha tests --reporter mochawesome --require mochawesome/register

Output

Mochawesome generates the following inside your project directory:

mochawesome-report/
├── assets
│   ├── app.css
│   ├── app.js
│   ├── MaterialIcons-Regular.woff
│   ├── MaterialIcons-Regular.woff2
│   ├── roboto-light-webfont.woff
│   ├── roboto-light-webfont.woff2
│   ├── roboto-medium-webfont.woff
│   ├── roboto-medium-webfont.woff2
│   ├── roboto-regular-webfont.woff
│   └── roboto-regular-webfont.woff2
├── mochawesome.html
└── mochawesome.json

The two main files to be aware of are:

mochawesome.html - The rendered report file

mochawesome.json - The raw json output used to render the report

Options

Options can be passed to the reporter in two ways.

Environment variables

The reporter will try to read environment variables that begin with MOCHAWESOME_.

$ export MOCHAWESOME_REPORTFILENAME=customReportFilename

Note that environment variables must be in uppercase.

Mocha reporter-options

You can pass comma-separated options to the reporter via mocha's --reporter-options flag. Options passed this way will take precedence over environment variables.

$ mocha test.js --reporter mochawesome --reporter-options reportDir=customReportDir,reportFilename=customReportFilename

Alternately, reporter-options can be passed in programatically:

var mocha = new Mocha({
  reporter: 'mochawesome',
  reporterOptions: {
    reportFilename: 'customReportFilename',
    quiet: true,
  },
});

Available Options

The options below are specific to the reporter. For a list of all available options see mochawesome-report-generator options.

Option NameTypeDefaultDescription
quietbooleanfalseSilence console messages
reportFilenamestringmochawesomeFilename of saved report (html and json)
See notes for available token replacements.
htmlbooleantrueSave the HTML output for the test run
jsonbooleantrueSave the JSON output for the test run
consoleReporterstringspecName of mocha reporter to use for console output, or none to disable console report output entirely

reportFilename replacement tokens

Using the following tokens it is possible to dynamically alter the filename of the generated report.

  • [name] will be replaced with the spec filename when possible.
  • [status] will be replaced with the status (pass/fail) of the test run.
  • [datetime] will be replaced with a timestamp. The format can be - specified using the timestamp option.

For example, given the spec cypress/integration/sample.spec.js and the following config:

{
  reporter: "mochawesome",
  reporterOptions: {
    reportFilename: "[status]_[datetime]-[name]-report",
    timestamp: "longDate"
  }
}

The resulting report file will be named pass_February_23_2022-sample-report.html

Note: The [name] replacement only occurs when mocha is running one spec file per process and outputting a separate report for each spec. The most common use-case is with Cypress.

Adding Test Context

Mochawesome ships with an addContext helper method that can be used to associate additional information with a test. This information will then be displayed inside the report.

Please note: arrow functions will not work with addContext. See the example.

addContext(testObj, context)

paramtypedescription
testObjobjectThe test object
contextstring|objectThe context to be added to the test

Context as a string

Simple strings will be displayed as is. If you pass a URL, the reporter will attempt to turn it into a link. If the URL links to an image or video, it will be shown inline.

Context as an object

Context passed as an object must adhere to the following shape:

{
  title: 'some title'; // must be a string
  value: {
  } // can be anything
}

Example

Be sure to use ES5 functions and not ES6 arrow functions when using addContext to ensure this references the test object.

const addContext = require('mochawesome/addContext');

describe('test suite', function () {
  it('should add context', function () {
    // context can be a simple string
    addContext(this, 'simple string');

    // context can be a url and the report will create a link
    addContext(this, 'http://www.url.com/pathname');

    // context can be an image url and the report will show it inline
    addContext(this, 'http://www.url.com/screenshot-maybe.jpg');

    // context can be an object with title and value properties
    addContext(this, {
      title: 'expected output',
      value: {
        a: 1,
        b: '2',
        c: 'd',
      },
    });
  });
});

It is also possible to use addContext from within a beforeEach or afterEach test hook.

describe('test suite', () => {
  beforeEach(function () {
    addContext(this, 'some context');
  });

  afterEach(function () {
    addContext(this, {
      title: 'afterEach context',
      value: { a: 1 },
    });
  });

  it('should display with beforeEach and afterEach context', () => {
    // assert something
  });
});

Typescript

This project does not maintain its own type definitions, however they are available on npm from DefinitelyTyped.

$ npm install --save-dev @types/mochawesome

Related

mochawesome-report-generator

License

mochawesome is MIT licensed.