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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@nomicfoundation/hardhat-node-test-reporter

v3.0.1

Published

A node:test reporter

Readme

Hardhat's node:test reporter

⚠️ This package is an internal Hardhat component and it's not meant to be used directly.

This package includes Hardhat 3's node:test reporter used by the hardhat-node-test-runner plugin.

Reporter style

This reporter mimics the Mocha's default Spec reporter, as close as possible.

It is designed to output information about the test runs as soon as possible and in test definition order.

Once the test run ends, it will output global information about it, based on the diagnostics emitted by node:test, and any custom or unrecognized diagnostics message.

Finally, it will output the failure reasons for all the failed tests.

It introduces a number of custom features to make it more suitable for use with Hardhat.

Demo

Stand-alone installation

hardhat-node-test-reporter comes built-in with Hardhat's node:test plugin. You don't need to install it separately. The reporter will be used automatically.

If you want to use the reporter in your own project, you can install it with npm (optionally, with a --save-dev flag):

npm install --save-dev @nomicfoundation/hardhat-node-test-reporter

Usage

If you want to use the reporter directly with node, you can do so by passing the --test-reporter flag:

node --test --test-reporter=@nomicfoundation/hardhat-node-test-reporter

Custom features

Slow Tests

Slow threshold is configured to 75ms. If a test case takes longer than that, it will be highlighted in red.

Test Coverage

Test coverage is currently not supported by this reporter.

GitHub Actions

This reporter is designed to work well with GitHub Actions. By default, it will create error annotations for failed tests. You can disable this feature by setting the NO_GITHUB_ACTIONS_ANNOTATIONS environment variable to true.

Colour Output

This reporter will colour the output by default in terminals that support it. You can forcefully disable this feature by setting the FORCE_COLOR environment variable to 0 (or passing a --no-color flag). Similarly, you can forcefully enable this feature by setting the FORCE_COLOR environment variable to 1 (or passing a --color flag).

The behaviour is inherited from the chalk package.

Colour Legend

| Output Type | Colour | | ----------- | ------------ | | Cancelled | Gray | | Error | Red | | Failure | Red | | Skipped | Cyan | | Success | Green (tick) | | TODO | Blue |

Nesting

This reporter will indicate nesting of test suites by indenting the output at 2-space wide intervals.

Error Formatting

This reporter will format errors in a human readable way.

It will:

  • try to print the error object together with its stack trace;
  • try to print the diff of the expected and actual values of the error object, if they are available;
  • print internal errors of aggregated errors;
  • truncate error cause stack traces after 3 levels;
  • hide node internals (including test runner internals) from the stack trace;
  • replace file URLs with relative paths (this should work on Windows, too).

Diagnostics

This reporter will aggregate and output diagnostics emitted by node:test at the end of the test run. If it doesn't recognize a diagnostic message, it will output them as-is after the well-known diagnostics.

Well-known diagnostics are:

  • tests
  • suites
  • pass
  • fail
  • cancelled
  • skipped
  • todo
  • duration_ms