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-html-report-pro

v1.0.0

Published

Professional HTML test report generator with interactive charts for Jest test results

Downloads

110

Readme

Jest HTML Report Pro

🚀 Professional HTML test report generator with interactive Chart.js visualizations for Jest test results.

Features

Interactive Charts

  • Doughnut chart showing test distribution by category (Happy Path, Error Paths, Edge Cases)
  • Bar chart displaying tests per functionality
  • Powered by Chart.js for smooth, interactive visualizations

🎨 Modern UI/UX

  • Beautiful gradient backgrounds
  • Animated checkmarks and hover effects
  • Responsive design
  • Professional styling with shadows and transitions

📊 Comprehensive Reports

  • Test success/failure statistics
  • Detailed breakdown by functionality
  • Categorized test results
  • Execution time and coverage metrics

Installation

As a dev dependency in your project:

npm install --save-dev jest-html-report-pro

Global installation:

npm install -g jest-html-report-pro

Usage

Step 1: Run Jest with JSON output

First, run your Jest tests and output the results to a JSON file:

jest --json --outputFile=test-results.json

Or add to your package.json scripts:

{
  "scripts": {
    "test:report": "jest --json --outputFile=test-results.json && jest-html-report"
  }
}

Step 2: Generate HTML Report

# Using default settings
jest-html-report

# Custom input/output files
jest-html-report -i test-results.json -o my-report.html

# Custom title and subtitle
jest-html-report -t "My Project Tests" -s "Sprint 23 - QA Report"

CLI Options

Options:
  -i, --input <file>      Input JSON file from Jest (default: test-results.json)
  -o, --output <file>     Output HTML file (default: test-report.html)
  -t, --title <title>     Report title (default: Test Report)
  -s, --subtitle <text>   Report subtitle (default: Generated on [date])
  -h, --help              Show help message

Programmatic Usage

You can also use it programmatically in your Node.js scripts:

const { generateReport } = require('jest-html-report-pro');
const fs = require('fs');

// Read Jest JSON results
const jestResults = JSON.parse(fs.readFileSync('test-results.json', 'utf8'));

// Generate HTML report
const html = generateReport(jestResults, {
  title: 'My Project Tests',
  subtitle: 'Generated on ' + new Date().toLocaleDateString(),
});

// Write to file
fs.writeFileSync('report.html', html, 'utf8');
console.log('Report generated successfully!');

Integration with NestJS

Add to your package.json:

{
  "scripts": {
    "test": "jest",
    "test:cov": "jest --coverage",
    "test:report": "jest --json --outputFile=test-results.json && jest-html-report -t 'NestJS Test Report' -o test-report.html"
  }
}

Then run:

npm run test:report

Example Output

The generated HTML report includes:

  • Summary Cards: Total tests, passed, failed, success rate
  • Interactive Charts:
    • Test category distribution (Happy Path vs Error Paths vs Edge Cases)
    • Tests per functionality (bar chart)
  • Detailed Test Results:
    • Organized by functionality
    • Grouped by test categories
    • Individual test case status with checkmarks
  • Footer Statistics: Functionalities count, pass rate, execution time

Report Structure

The report automatically organizes tests based on your Jest describe blocks:

describe('MyService', () => {
  describe('myMethod()', () => {        // Functionality level
    describe('Happy Path', () => {      // Category level
      it('should work correctly', ...); // Test level
    });
  });
});

Requirements

  • Node.js >= 14.0.0
  • Jest test framework
  • Internet connection (for Chart.js CDN)

License

MIT

Author

Your Name

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Issues

Found a bug or have a feature request? Please open an issue on GitHub.

Changelog

v1.0.0

  • Initial release
  • Interactive Chart.js visualizations
  • Modern gradient UI
  • CLI support
  • Programmatic API