mocha-allure-reporter vs jasmine-allure-reporter
JavaScript Testing Framework Reporters Comparison
1 Year
mocha-allure-reporterjasmine-allure-reporterSimilar Packages:
What's JavaScript Testing Framework Reporters?

Both Jasmine and Mocha are popular JavaScript testing frameworks, and their respective Allure reporters enhance the reporting capabilities of tests run with these frameworks. Jasmine is a behavior-driven development (BDD) framework that provides a clean syntax for writing tests, while Mocha is a flexible test framework that supports various styles of testing, including BDD and TDD. The Allure reporters for both frameworks allow for the generation of visually appealing and informative test reports that can help developers and QA teams understand test outcomes and failures more effectively. These reports can include detailed information about test execution, including steps, attachments, and statuses, making it easier to track down issues and improve the testing process.

Package Weekly Downloads Trend
Github Stars Ranking
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
mocha-allure-reporter22,4104526.1 kB0-Apache-2.0
jasmine-allure-reporter14,83435-237 years agoISC
Feature Comparison: mocha-allure-reporter vs jasmine-allure-reporter

Integration

  • mocha-allure-reporter:

    The mocha-allure-reporter integrates with Mocha, leveraging Mocha's hooks and test lifecycle events to capture detailed information about test execution. It can be easily configured to work with different Mocha setups, making it versatile for various testing environments.

  • jasmine-allure-reporter:

    The jasmine-allure-reporter is specifically designed to integrate with Jasmine, allowing for easy setup and usage within Jasmine test suites. It captures Jasmine's test results and formats them into Allure reports without requiring extensive configuration.

Report Customization

  • mocha-allure-reporter:

    Mocha-allure-reporter provides options for customizing the reporting output, allowing developers to specify how tests are grouped and displayed in the Allure report. This flexibility can help tailor reports to better fit project needs.

  • jasmine-allure-reporter:

    This reporter allows for some level of customization in the generated Allure reports, enabling developers to include additional metadata, such as test descriptions and attachments, which can enhance the clarity and usefulness of the reports.

Output Format

  • mocha-allure-reporter:

    Mocha-allure-reporter also outputs results in the standard Allure format, making it easy to integrate with existing Allure reporting tools. This ensures that regardless of the testing framework used, the reporting remains consistent and accessible.

  • jasmine-allure-reporter:

    The output generated by jasmine-allure-reporter is compatible with Allure's standard format, ensuring that reports can be easily viewed and analyzed using Allure's reporting tools. This standardization helps maintain consistency across different projects that may use various testing frameworks.

Community Support

  • mocha-allure-reporter:

    Mocha-allure-reporter is supported by the broader Mocha community, which is known for its active development and extensive documentation. This community support can help users quickly resolve issues and adopt best practices.

  • jasmine-allure-reporter:

    As part of the Jasmine ecosystem, jasmine-allure-reporter benefits from a community that actively maintains and updates the package. This support can be crucial for troubleshooting and ensuring compatibility with the latest Jasmine versions.

Ease of Use

  • mocha-allure-reporter:

    Mocha-allure-reporter is also designed for ease of use, with clear documentation and examples that help developers integrate it into their Mocha test suites without significant overhead.

  • jasmine-allure-reporter:

    The setup process for jasmine-allure-reporter is straightforward, making it easy for developers to start generating Allure reports with minimal configuration. This ease of use is particularly beneficial for teams looking to quickly enhance their testing process.

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

    Choose mocha-allure-reporter if you are using Mocha as your testing framework and require flexibility in your testing style. Mocha's support for various testing paradigms allows you to adopt a structure that best fits your project, and this reporter will enhance your test reports with detailed insights.

  • jasmine-allure-reporter:

    Choose jasmine-allure-reporter if you are already using Jasmine for your testing needs and prefer a BDD style of writing tests. This reporter integrates seamlessly with Jasmine, providing a straightforward way to generate Allure reports that reflect the behavior-driven approach of your tests.

README for mocha-allure-reporter

mocha-allure-reporter Build Status

Allure reporter for Mocha

Installation

Assuming that you have mocha installed, install reporter via npm:

npm install mocha-allure-reporter

Then use it as any other mocha reporter:

mocha --reporter mocha-allure-reporter

After running tests you will get raw tests result into allure-results directory. See generator list on how to make a report from raw results.

Also check out mocha-allure-example to see it in action.

Supported options

  • targetDir (string) – directory where test results will be stored

Runtime API

Allure is a test framework which provides more data from tests than usual. Once added mocha-allure-reporter will create global allure object with the following API:

  • allure.createStep(name, stepFn) – define step function. Result of each call of this function will be recorded into report.
  • allure.createAttachement(name, content, [type]) – save attachment to test. If you're calling this inside step function or during its execution (e.g. asynchronously via promises), attachment will be saved to step function.
    • name (String) - attachment name. Note that it is not then name of the file, actual filename will be generated.
    • content (Buffer|String|Function) – attachment content. If you pass Buffer or String, it will be saved to file immediately. If you are passing Function, you will get decorated function and you can call it several times to trigger attachment. General purpose of the second case is an ability to create utility function to take screenshot. You can define function for you test framework only once and then call it each time you need a screenshot.
    • type (String, optional) – attachment MIME-type. If you omit this argument we'll try to detect type automatically via file-type library
  • allure.description(description) – set detailed test description, if test name is not enough.
  • allure.severity(severity) – set test severity, one of: blocker, critical, normal, minor, trivial. You can also use constants like allure.SEVERITY.BLOKER.
  • allure.feature(featureName) – assign feature to test
  • allure.story(storyName) – assign user story to test. See documentation for details
  • allure.addArgument(name, value) - provide parameters, which had been used in test. Unlike other languages, javascript test methods usually doesn't have special arguments (only callbacks), so developers use other way to populate parameters to test. This method is to provide them to Allure
  • allure.addEnvironment(name, value) - save environment value. It is similar to addArgument method, but it is designed to store more verbose data, like HTTP-links to test page or used package version.