Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-allure2-reporter

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-allure2-reporter

Idiomatic Jest reporter for Allure Framework

  • 1.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4K
decreased by-31.71%
Maintainers
1
Weekly downloads
 
Created
Source

jest-allure2-reporter

npm version CI semantic-release: angular Commitizen friendly

Example screenshot

Installation

Before you start, make sure you have Allure CLI installed.

Your project should have jest installed. The minimum supported version is 27.x.

Run in your project:

npm install --save-dev jest-allure2-reporter

Edit your jest.config.js:

module.exports = {
  // ...
  reporters: [
    'default',
+   'jest-allure2-reporter',
  ],
};

Customization

By default, the reporter will write the results to allure-results directory. You can change this by setting the resultsDir option:

module.exports = {
  // ...
  reporters: [
    'default',
    [
      'jest-allure2-reporter',
+     { resultsDir: 'my-results-dir' },
    ],
  ],
};

Below is a list of all the available options:

PropertyTypeDefaultDescription
errorsAsFailedAssertionsbooleanfalseTreat thrown errors as failed assertions. By default, the reporter distinguishes between failed assertions and thrown errors. The former are reported as FAILED tests, the latter as BROKEN tests.
getEnvironmentInfofunction or booleantrueCan be customized with an async function to extract environment information from the test environment. By default, the environment information is extracted from the process.env object. Use false to disable environment information.
overwriteResultsDirbooleantrueWhether the reporter should delete the results directory before running tests.
packageNamestringrequire('./package.json').nameAdd an extra label to each test case with the package name. Helpful when running tests from multiple packages in a monorepo.
resultsDirstring<rootDir>/allure-resultsPath to the directory where the report will be generated.

Usage

Run your tests with jest as usual and then view the results:

allure serve

If you use a custom resultsDir, you should specify it in the allure serve command, e.g.:

allure serve your-results-dir # if you use a custom `resultsDir`

If you want to generate a static report, e.g., for CI, run:

allure generate

For more information, see the Allure CLI documentation.

Contributing

See CONTRIBUTING.md.

License

MIT License

Keywords

FAQs

Package last updated on 19 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc