jest-allure vs mocha-allure-reporter vs jasmine-allure-reporter
Allure Reporting Libraries for Testing Frameworks
jest-alluremocha-allure-reporterjasmine-allure-reporterSimilar Packages:
Allure Reporting Libraries for Testing Frameworks

Allure reporting libraries provide a way to generate visually appealing and informative test reports for various JavaScript testing frameworks. These libraries enhance the testing experience by offering detailed insights into test execution, including pass/fail status, execution time, and error messages. They help developers and QA teams understand test results quickly and effectively, facilitating better debugging and improving overall code quality. Each library integrates seamlessly with its respective testing framework, ensuring that the reporting process is straightforward and efficient.

Npm Package Weekly Downloads Trend
3 Years
Github Stars Ranking
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
jest-allure25,90411622.8 kB35-MIT
mocha-allure-reporter21,6524526.1 kB0-Apache-2.0
jasmine-allure-reporter11,28334-238 years agoISC
Feature Comparison: jest-allure vs mocha-allure-reporter vs jasmine-allure-reporter

Integration

  • jest-allure:

    jest-allure is specifically built for Jest, making it easy to implement Allure reporting in Jest-based projects. It leverages Jest's built-in features, such as snapshot testing and parallel execution, to enhance reporting accuracy and detail.

  • mocha-allure-reporter:

    mocha-allure-reporter integrates with Mocha, enabling you to generate Allure reports from your Mocha tests. It captures the essence of Mocha's testing style while providing a structured reporting format that enhances test visibility.

  • jasmine-allure-reporter:

    This package integrates seamlessly with Jasmine, allowing you to add Allure reporting capabilities without altering your existing test structure. It captures test results and logs them in a format that Allure understands, ensuring a smooth reporting process.

Report Customization

  • jest-allure:

    jest-allure provides options for customizing the report output, including the ability to adjust the level of detail in the reports. This flexibility allows developers to focus on the most relevant information for their testing needs.

  • mocha-allure-reporter:

    mocha-allure-reporter supports customization of report generation, allowing developers to specify details such as test descriptions and categories. This feature enhances the readability and organization of the test reports.

  • jasmine-allure-reporter:

    This reporter allows for some customization of the generated reports, enabling you to tailor the output to meet your project's specific needs. You can configure options such as report file paths and test suite names to improve report clarity.

Ease of Use

  • jest-allure:

    jest-allure is designed for ease of integration with Jest, requiring only a few lines of configuration to enable Allure reporting. Its user-friendly setup process makes it accessible for developers of all skill levels.

  • mocha-allure-reporter:

    mocha-allure-reporter is easy to implement in existing Mocha projects, with clear documentation guiding users through the setup process. This simplicity allows teams to quickly adopt Allure reporting without extensive overhead.

  • jasmine-allure-reporter:

    The setup process for jasmine-allure-reporter is straightforward, requiring minimal configuration to get started. This ease of use makes it an attractive option for projects already using Jasmine.

Community Support

  • jest-allure:

    jest-allure enjoys robust community backing due to Jest's popularity in the JavaScript ecosystem. This support translates to regular updates and a wealth of resources for troubleshooting and best practices.

  • mocha-allure-reporter:

    mocha-allure-reporter has a dedicated user base that actively contributes to its development. The community provides valuable insights and assistance, making it easier for new users to adopt and implement the reporter.

  • jasmine-allure-reporter:

    As a widely used reporter for Jasmine, jasmine-allure-reporter benefits from a strong community that contributes to its maintenance and improvement. This community support ensures that issues are addressed promptly and that the package remains up-to-date with Jasmine's developments.

Performance Impact

  • jest-allure:

    jest-allure is optimized for performance, ensuring that the reporting process does not hinder Jest's fast test execution capabilities. This optimization is essential for maintaining high productivity during development cycles.

  • mocha-allure-reporter:

    mocha-allure-reporter is designed to have a low performance overhead, allowing Mocha tests to run efficiently while still generating comprehensive reports. This balance is vital for teams that prioritize speed in their testing processes.

  • jasmine-allure-reporter:

    The performance impact of jasmine-allure-reporter is minimal, as it efficiently logs test results without significantly slowing down test execution. This efficiency is crucial for maintaining fast feedback loops in development.

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

    Opt for jest-allure if you are using Jest for your testing needs. This package is designed specifically for Jest and takes advantage of its features, such as parallel test execution, to generate detailed Allure reports. It is ideal for modern JavaScript applications that utilize Jest's powerful testing capabilities.

  • mocha-allure-reporter:

    Select mocha-allure-reporter if your project is based on Mocha. This package allows you to create Allure reports from Mocha tests, providing a clear and structured output of test results. It is beneficial for projects that require flexibility in testing and reporting, leveraging Mocha's extensive features.

  • jasmine-allure-reporter:

    Choose jasmine-allure-reporter if you are using Jasmine as your testing framework. It integrates well with Jasmine's syntax and provides a comprehensive reporting solution that captures all test results and logs them in an Allure-compatible format, making it suitable for projects already leveraging Jasmine.

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