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

@zyplux/tests-fixtures

v0.4.0

Published

Story-test fixtures for zyplux workspaces: Bun.$ shell fake, console capture, fetch routing, temp dirs, domain matchers, and vitest test.extend bases per app type

Readme

@zyplux/tests-fixtures

Story-test fixtures for code built on Bun and @zyplux/util. Fakes swap in at the lowest boundary (Bun.$, fetch, console, prompt, Bun.sleep, process.env) so tests exercise only public interfaces. Ships TypeScript source, consumed directly under Bun.

Install

bun add -d @zyplux/tests-fixtures

Use

Pick a base per app type, extend it with suite fixtures, and keep the binding named test:

import { cliTest } from '@zyplux/tests-fixtures';

export const test = cliTest;
export { describe, expect } from 'vitest';
import { describe, expect, test } from '#fixtures';

describe('1.1 pushing a branch', () => {
  test('1.1.1 pushes and reports the PR url', async ({ logs, shell }) => {
    shell.on('git rev-parse --abbrev-ref HEAD', 'feat-x');
    shell.on('git push', '');

    await runPushBranch({ command: 'push-branch', hold: false, ready: false });

    expect(shell).toHaveRun('git push --set-upstream origin feat-x');
    expect(logs).toHaveLogged('PR (draft): https://github.com/acme/repo/pull/1');
  });
});

Bases

  • libraryTest — lazy fixtures: shell (fake Bun.$, installed only when destructured), tempDir (auto-removed scratch directory with path, write, exists).
  • cliTest — extends libraryTest; auto-silences and captures console (logs), makes Bun.sleep instant; adds lazy network (fake fetch), prompt (fake globalThis.prompt that accepts and records every message), and env (set(name, value) stubs an env var for the test).

Fakes

  • createShellFake() — routes commands (on(pattern, ...replies), later routes win, the last reply repeats; otherwise(reply) sets a fallback, unrouted commands throw) and records calls ({ argv, program }), commands (rendered strings), commandsMatching(pattern).
  • createConsoleCapture() — records logLines/warnLines/errorLines.
  • createFetchFake() — routes urls (on(prefixOrRegExp, reply), otherwise(reply)) and records requests; okResponse()/notFoundResponse() build replies.
  • createPromptFake() — accepts every prompt() call and records messages.
  • createTempDir()path, write(relativePath, content), exists(relativePath), remove().
  • fakeShellOutput(stdout, exitCode?), fakeShellPromise(result), toArgv(values) — raw Bun.$ doubles behind createShellFake.

Matchers

Importing a base registers domain matchers via expect.extend:

  • expect(shell).toHaveRun(command) — the exact rendered command ran.
  • expect(shell).toHaveRunMatching(pattern) — some command matches (string = command prefix at a word boundary, same as on; RegExp = test); negate with .not for "never ran".
  • expect(logs).toHaveLogged(line?) / toHaveWarned(line?) / toHaveErrored(line?) — a captured line equals the string (or matches the RegExp); with no argument, that the channel captured anything, so .not.toHaveWarned() asserts silence.