jest-allure vs jasmine-allure-reporter vs mocha-allure-reporter
Allure Test Reporting Integration for JavaScript Test Runners
jest-allurejasmine-allure-reportermocha-allure-reporterSimilar Packages:

Allure Test Reporting Integration for JavaScript Test Runners

jasmine-allure-reporter, jest-allure, and mocha-allure-reporter are integration packages that connect JavaScript test runners (Jasmine, Jest, and Mocha, respectively) to the Allure test reporting framework. Allure generates rich, interactive HTML reports that visualize test execution timelines, group tests by features or epics, display attachments (like screenshots or logs), and provide detailed failure analysis. These reporters translate test events and metadata from their respective test frameworks into Allure's internal data model, enabling developers to produce standardized, professional-grade test reports regardless of their underlying test runner.

Npm Package Weekly Downloads Trend

3 Years

Github Stars Ranking

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
jest-allure26,05611622.8 kB35-MIT
jasmine-allure-reporter034-238 years agoISC
mocha-allure-reporter04526.1 kB0-Apache-2.0

Allure Reporting for JavaScript Test Runners: Jasmine, Jest, and Mocha Compared

Allure is a flexible, open-source test reporting framework that generates rich, interactive test reports with detailed timelines, attachments, steps, and failure analysis. In the JavaScript ecosystem, integrating Allure into your testing workflow requires a reporter plugin specific to your test runner. The three main options — jasmine-allure-reporter, jest-allure, and mocha-allure-reporter — each bridge their respective test frameworks to Allure’s data model. However, they differ significantly in architecture, feature support, and maintenance status. Let’s break down how they work and which one fits your stack.

⚠️ Maintenance Status: One Is Deprecated

Before diving into features, it’s critical to note that jasmine-allure-reporter is officially deprecated. According to its npm page, the package is no longer maintained and users are encouraged to migrate to alternatives. This alone disqualifies it for new projects.

// DO NOT use this in new projects
const JasmineAllureReporter = require('jasmine-allure-reporter');
jasmine.getEnv().addReporter(new JasmineAllureReporter());

In contrast, both jest-allure and mocha-allure-reporter are actively maintained and compatible with recent versions of their respective test runners.

🧪 Test Runner Integration: How Each Hooks Into Your Tests

jasmine-allure-reporter (Deprecated)

This reporter attaches directly to Jasmine’s global environment via jasmine.getEnv().addReporter(). It listens to Jasmine’s lifecycle events (suiteStarted, specStarted, etc.) and translates them into Allure results.

// jasmine-allure-reporter (deprecated)
const reporter = require('jasmine-allure-reporter');
jasmine.getEnv().addReporter(reporter);

It supports basic Allure features like test descriptions and severity labels via custom matchers or metadata, but lacks modern capabilities like step nesting or attachments.

jest-allure

jest-allure integrates as a Jest environment or reporter, depending on usage. The recommended approach uses the AllureEnvironment to wrap test execution and expose an allure object globally.

// jest.config.js
module.exports = {
  testEnvironment: 'node',
  setupFilesAfterEnv: ['jest-allure/dist/setup'],
};

// In your test file
allure.description('Verifies user login flow');
allure.label('severity', 'critical');
test('logs in successfully', () => {
  // ...
});

This gives you direct access to the Allure API inside tests, enabling fine-grained control over test metadata, steps, and attachments.

mocha-allure-reporter

This reporter plugs into Mocha via the --reporter CLI flag or programmatically through Mocha’s reporter() method. It captures Mocha’s test events and maps them to Allure’s model.

// Via CLI
mocha --reporter mocha-allure-reporter test/*.js

// Programmatically
const Mocha = require('mocha');
const mocha = new Mocha();
mocha.reporter('mocha-allure-reporter');

It also provides a global allure object during test execution, similar to jest-allure, allowing manual enrichment of test cases.

// In a Mocha test
it('should create a user', function() {
  allure.feature('User Management');
  allure.step('Send POST request', () => {
    // ...
  });
});

📝 Feature Support: Steps, Attachments, and Labels

All three packages aim to support core Allure concepts, but implementation depth varies.

Test Steps

  • jasmine-allure-reporter: No native step support. You must manually manage step-like behavior using nested describe blocks, which doesn’t translate to Allure steps.

  • jest-allure: Full step support via allure.step():

allure.step('Validate input', () => {
  expect(input).toBeTruthy();
});
  • mocha-allure-reporter: Also supports allure.step() with identical syntax:
allure.step('Check response status', () => {
  assert.equal(res.statusCode, 200);
});

Attachments

  • jasmine-allure-reporter: No attachment API.

  • jest-allure: Supports binary and text attachments:

allure.attachment('Screenshot', screenshotBuffer, 'image/png');
  • mocha-allure-reporter: Same attachment API:
allure.attachment('Log file', logContent, 'text/plain');

Labels and Metadata

Both jest-allure and mocha-allure-reporter allow setting Allure labels (e.g., epic, feature, story, severity) directly in tests:

// jest-allure
allure.epic('Authentication');
allure.story('Login with valid credentials');

// mocha-allure-reporter
allure.label('epic', 'Authentication');
allure.label('story', 'Login with valid credentials');

jasmine-allure-reporter only supports limited metadata via Jasmine’s built-in mechanisms, which don’t map cleanly to Allure’s labeling system.

🛠️ Configuration and Output

All three write Allure result files (.json or .xml) to a configured output directory (default: allure-results). However, only the active reporters (jest-allure, mocha-allure-reporter) support modern configuration options.

For example, in jest-allure, you can customize the results directory via environment variables:

ALLURE_RESULTS_DIR=./custom-results npx jest

Similarly, mocha-allure-reporter respects the ALLURE_RESULTS_DIR env var or can be configured programmatically.

jasmine-allure-reporter offers minimal configuration and hardcodes paths in older versions.

🔄 Real-World Usage Scenarios

Scenario 1: You’re Using Jasmine (Legacy Project)

If you’re stuck on Jasmine due to legacy code, do not add jasmine-allure-reporter to new tests. Instead, consider migrating to Jest or Mocha incrementally, or use a generic Allure adapter that doesn’t rely on this deprecated package.

Scenario 2: You’re Using Jest (Modern Frontend Stack)

Choose jest-allure. It integrates cleanly with Jest’s setup lifecycle, supports TypeScript out of the box, and gives you full access to Allure’s feature set without polluting your test globals excessively.

Scenario 3: You’re Using Mocha (Node.js or Legacy Browser Tests)

Go with mocha-allure-reporter. It’s stable, well-documented, and works seamlessly with Mocha’s flexible test structure, including async hooks and dynamic test generation.

📊 Summary Table

Featurejasmine-allure-reporterjest-alluremocha-allure-reporter
Maintenance Status❌ Deprecated✅ Active✅ Active
Test Steps❌ Not supportedallure.step()allure.step()
Attachments❌ Not supported✅ Full support✅ Full support
Labels (epic, etc.)⚠️ Limited✅ Direct methods✅ Via allure.label()
Integration MethodJasmine reporterJest setup fileMocha CLI or programmatic
Recommended For❌ Avoid✅ New Jest projects✅ Mocha-based projects

💡 Final Recommendation

  • Avoid jasmine-allure-reporter entirely — it’s deprecated and lacks modern Allure features.
  • If your project uses Jest, jest-allure is the clear choice: it’s well-maintained, feature-complete, and integrates smoothly with Jest’s conventions.
  • If you’re on Mocha, mocha-allure-reporter is mature, reliable, and gives you the same level of control over Allure reporting as its Jest counterpart.

Ultimately, your test runner dictates your Allure reporter. But with Jasmine’s option off the table, the decision comes down to aligning with your existing testing infrastructure — not comparing feature parity between equally viable tools.

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

  • jest-allure:

    Choose jest-allure if your project uses Jest as its test runner. It provides full access to Allure's feature set — including test steps, attachments, and labels — through a clean global allure object, integrates via Jest's standard setup mechanism, and is actively maintained with good TypeScript support.

  • jasmine-allure-reporter:

    Do not choose jasmine-allure-reporter for any new project — it is officially deprecated according to its npm page and lacks support for modern Allure features like test steps and attachments. If you're maintaining a legacy Jasmine codebase, prioritize migrating to a supported test runner like Jest or Mocha instead of relying on this unmaintained package.

  • mocha-allure-reporter:

    Choose mocha-allure-reporter if you're using Mocha for testing, especially in Node.js environments or legacy browser test suites. It offers complete Allure integration with step tracking, attachments, and metadata labeling, and can be configured via CLI flags or programmatically, making it flexible for various Mocha setups.

README for jest-allure

Jest-Allure reporting plugin

Add more power to your tests using Jest-Allure. Easily generate nice reports at the end of the execution.

Awesome License: MIT PRs Welcome

GitHub followers GitHub stars GitHub watchers

Examples


Allure Report

Allure Framework is a flexible lightweight multi-language test report tool that not only shows a very concise representation of what have been tested in a neat web report form, but allows everyone participating in the development process to extract maximum of useful information from everyday execution of tests.

Installation

yarn add -D jest-allure

or

npm install --save-dev jest-allure

jest -v >24 ?

Then add jest-allure/dist/setup to setupFilesAfterEnv section of your config.

setupFilesAfterEnv: ["jest-allure/dist/setup"]

jest -v < 24 ?

add reporter to jest.config.js

reporters: ["default", "jest-allure"],

Run your tests and enjoy 🥤🚀


How to get a report

You need to install the CLI in order to obtain a report.

To see a report in browser, run in console

allure serve

If you want to generate html version, run in console

allure generate

Advanced features

You can add description, screenshots, steps, severity and lots of other fancy stuff to your reports.

Global variable reporter available in your tests with such methods:

    description(description: string): this;
    severity(severity: Severity): this;
    epic(epic: string): this;
    feature(feature: string): this;
    story(story: string): this;
    startStep(name: string): this;
    endStep(status?: Status): this;
    addArgument(name: string): this;
    addEnvironment(name: string, value: string): this;
    addAttachment(name: string, buffer: any, type: string): this;
    addLabel(name: string, value: string): this;
    addParameter(paramName: string, name: string, value: string): this;

Example

import { Severity } from "jest-allure/dist/Reporter";
import { Feature } from "somwhere in your project";

describe("Fancy test", () => {
        ...
        
        it("Test your amazing feature", async () => {
            reporter
                .description("Feature should work cool")
                .severity(Severity.Critical)
                .feature(Feature.Betting)
                .story("BOND-007");

            reporter.startStep("Check it's fancy");
            // expect that it's fancy
            reporter.endStep();
            
            reporter.startStep("Check it's cool");
            // expect that it's cool
            reporter.endStep();

            const screenshotBuffer = await page.screenshot();
            reporter.addAttachment("Screenshot", screenshotBuffer, "image/png");
        });
        
        ...
    }
);

What's next

  • Generate report from Jest results
  • Add steps support
  • Add labels support
  • Add attachments support
  • Add more examples

Additional projects

visual-unit-tests

jest-allure-image-snapshot

Warning

jest-allure reporter dynamically configure "setupTestFrameworkScriptFile" option in Jest configuration. If you have your own setupTestFrameworkScriptFile file, you need to manually register allure reporter, for it you need to import jest-allure/dist/setup.

import "jest-allure/dist/setup";

In case if you have jest version > 24 just add jest-allure/dist/setup to setupFilesAfterEnv section of your config.

Contributors


Denis Artyuhovich

Dmitry Bogomya