npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

jest-allure2-reporter

v2.3.0

Published

Idiomatic Jest reporter for Allure Framework

Readme

Stand With Ukraine

jest-allure2-reporter

Allure Framework integration for Jest tests - beautiful, detailed reports

npm version CI semantic-release: angular Commitizen friendly

What is jest-allure2-reporter?

This library connects Jest tests with Allure Framework to generate rich, interactive test reports that provide:

  • Clear test execution flows with step-by-step breakdowns
  • Attachments (screenshots, logs, data)
  • Historical test data and trends
  • Comprehensive context for easier debugging

Jest Allure2 Reporter Demo

As shown in the video, you can easily:

  • Add metadata with docblock pragmas or the programmatic API
  • Automatically track steps and attach artifacts using decorators
  • Organize your tests with powerful configuration options

Quick Installation

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

Configure Jest (e.g., in jest.config.js):

/** @type {import('@jest/types').Config.InitialOptions} */
module.exports = {
  // Add to your existing configuration
  reporters: [
    'default', // Keep for console output
    'jest-allure2-reporter',
  ],
  testEnvironment: 'jest-allure2-reporter/environment-node',
  // Or for browser testing: 'jest-allure2-reporter/environment-jsdom'
};

Key Features

  • Test Steps: Define and visualize test steps using the @Step decorator
  • Rich Attachments: Add screenshots, logs, JSON data, etc. to your test reports
  • Test Metadata: Enhance reports with descriptions, links, tags, and more
  • TypeScript Support: Comprehensive type definitions for better development
  • Visual Regression: Support for image snapshot comparisons and diff visualization

Basic Usage

// my-page.ts
import { allure, Step } from 'jest-allure2-reporter/api';

export class MyPage {
  @Step('Load user data for ID: {{userId}}')
  async loadUserData(userId: string) {
    // Fetch data logic...
    const userData = { name: 'John Doe', id: userId };

    // Add JSON attachment
    allure.attachment('User Data', JSON.stringify(userData, null, 2), 'application/json');
    return userData;
  }
}

// my.test.ts
import { allure } from 'jest-allure2-reporter/api';
import { MyPage } from './my-page';

describe('User Profile', () => {
  const page = new MyPage();

  it('should load user data correctly', async () => {
    // Add metadata
    allure.feature('Profile');
    allure.severity('critical');

    const userData = await page.loadUserData('user123');
    expect(userData.name).toBe('John Doe');
  });
});

Generating Reports

After running your tests, generate the Allure report:

# Install Allure command line if needed
npm install -g allure-commandline

# Generate and open report
allure generate allure-results --clean
allure open

For CI environments:

ALLURE_NO_ANALYTICS=1 allure generate allure-results --clean

Core Features

Test Steps with @Step

@Step('Add item "{{itemName}}" to cart')
async addItemToCart(itemName: string, quantity: number) {
  allure.parameter('Quantity', quantity);
  // Implementation...
}

Attachments

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

// Method decorator
@Attachment('Order Details', 'application/json')
getOrderDetails() {
  return JSON.stringify(this.orderData);
}

// File attachment
@FileAttachment('Invoice', 'application/pdf')
getInvoicePath() {
  return '/path/to/invoice.pdf';
}

Test Metadata

// Runtime API
allure.epic('User Management');
allure.feature('Registration');
allure.tag('smoke', 'critical');
allure.link('https://example.com/requirements/REQ-101', 'REQ-101');

// Docblock annotations
/**
 * @epic Product Discovery
 * @feature Product Details
 * @severity blocker
 */
describe('Product Details', () => {
  // Tests...
});

// BDD-style
$Epic('E-commerce');
$Feature('Shopping Cart');
describe('Cart Functionality', () => {
  // Tests...
});

Configuration

For advanced configuration options including custom categories, environment details, and more, refer to our documentation.

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

MIT License