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-meta-reporter

v0.0.4

Published

Are you frustrated with constantly adding console.log statements to your tests in order to debug failed cases, only to have to go back and remove them afterward so they don't clog up the cli when running passing tests? If so, jest-meta-reporter is the per

Readme

jest-meta-reporter

Are you frustrated with constantly adding console.log statements to your tests in order to debug failed cases, only to have to go back and remove them afterward so they don't clog up the cli when running passing tests? If so, jest-meta-reporter is the perfect solution for streamlining your testing process!

With jest-meta-reporter, you can easily set or push custom metadata into your tests, and it will only output when a test fails. This eliminates the clutter of unnecessary logs during successful test runs, helping you keep your testing environment clean and focused. Say goodbye to the hassle of manual cleanup and hello to more efficient debugging!

How to setup

If you're running tests in a Node.js environment, add the following lines to your Jest config:

{
+  "testEnvironment": "jest-metadata/environment-node",
+  "reporters": [
-    "default"
+    "jest-meta-reporter"
+  ]
}

If you need a JSDOM environment, you need to change the above test environment to:

{
+  "testEnvironment": "jest-metadata/environment-jsdom",
}

Available exports are get, set, or push. The default is the Reporter for jest which you will not need for normal tests.

import { push, set } from 'jest-meta-reporter';

describe('When the world', () => {
  it('should expect the impossible', () => {
    const id: string = someRandomId();
    set(id);

    const someOtherId: string = someRandomId();
    push({ someOtherId });

    expect(true).toBe(false);
  });
});

Running your test, the failure output should look similar to this

 FAIL  test/single.test.ts run...
  ● When the world › should expect the impossible

    expect(received).toBe(expected) // Object.is equality

    Expected: false
    Received: true

      13 |     Meta.push({ someOtherId });
      14 |
    > 15 |     expect(true).toBe(false);
         |                  ^
      16 |   });
      17 | });
      18 |

      at Object.<anonymous> (test/single.test.ts:15:18)

When the world > should expect the impossible metadata:
[
  "random_123"
  {
    "someOtherId": "random_456"
  }
]

Options

outputDefault: boolean

Builds a DefaultReporter and attempts to output metadata as close to the failing test as possible. Note that if multiple tests fail in the same test file, the test default reporter will output all failed tests and then jest-meta-reporter will output any failed test metadata. Default true.

{
  "reporters": [
    "default",
    ["jest-meta-reporter", { "outputDefault": true }]
  ]
}

Development

Repo is managed with projen, any config besides eslint (currently) should be changed in the .projenrc.ts file. Setup dependencies with yarn install first. Lint with yarn eslint or npx projen eslint. Test with yarn test or npx projen test. The build script will lint, test, and bundle. Released when merged to main branch.

ToDo Improvements

  • Metadata output formatting? Using JSON.stringify(data, undefined, 2) good enough?
  • 'Attaching' to default reporter to output. If multiple tests in file fail, meta is output in a clump after test fail output. Maybe implement custom output instead? Or use jest output formatting per test instead?