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

@spikedpunch/cbd-jest

v0.0.4

Published

Jest adapter: a test environment that records per-test coverage windows and selects with them.

Readme

@spikedpunch/cbd-jest

The Jest adapter for CBD. A custom test environment records per-test coverage windows, and a config helper turns a selection into Jest's own name filter.

Install

pnpm add -D @spikedpunch/cbd-jest jest-environment-node @spikedpunch/cbd @spikedpunch/cbd-cli

Peer dependencies: jest >=29 <31 and jest-environment-node >=29 <31. Validated on Jest 29.6 and 30.5.

Setup

// jest.config.cjs
const { withCbd } = require('@spikedpunch/cbd-jest/config')

module.exports = withCbd({
  testEnvironment: '@spikedpunch/cbd-jest/environment',
})
  • testEnvironment records windows (one environment and one shard per test file).
  • withCbd applies CBD_SELECTION as an anchored testNamePattern. Without it, recording still works but the run is not narrowed. Without CBD_SELECTION the config is returned unchanged.

Both can live in a committed config: with CBD_SHARD and CBD_SELECTION unset they are inert.

Recording and selecting

pnpm exec cbd collect -- pnpm jest
pnpm exec cbd select

cbd collect sets CBD_SHARD and CBD_COMMIT for the run (and CBD_SELECTION for a subset), then builds the map.

Jest creates one environment per test file, and setup() is awaited before the file is evaluated, so the file's imports land in @load and teardown() writes the footer. Windows are the awaited test_start / test_done events. Identity is the enclosing describe names plus the test name, with Jest's synthetic ROOT_DESCRIBE_BLOCK omitted.

Why selection lives in the config

Jest's testNamePattern is the only filter that sees a fully expanded test name, including test.each / describe.each rows. The config is loaded before the run, which is early enough to read the selection file. A setup-file wrapper cannot do this: .each rows bypass it, and silently skipping a selected row is the failure CBD does not accept. Titles are escaped and joined into one alternation (> becomes whitespace), anchored so Should throw does not also match Should throw 2.

Notes

  • Test identity is the suite path plus the test name; same-named tests in different describe blocks stay distinct.
  • Statically skipped and todo tests open no window.
  • A failed test's window does not enter the map.
  • Jest's own --coverage must be off during a collection.

See CBD.md for the model and the root README for the CLI and config.