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

@zudojs/testing

v1.0.0

Published

Test helpers, fixtures, mocks, and utilities for testing Zudojs applications.

Readme

@zudojs/testing

Test helpers, fixtures, mocks, and assertions for Zudojs applications.

Installation

npm install --save-dev @zudojs/testing

Quick Start

import {
  createCleanupManager,
  createMockFn,
  createSpyLogger,
  createTestClock,
  createTestContainer,
} from "@zudojs/testing";

const container = createTestContainer({
  overrides: [{ token: databaseToken, useValue: fakeDatabase }],
});

const logger = createSpyLogger("test");
const clock = createTestClock(0); // pinned to the epoch
const cleanup = createCleanupManager();

const findUser = createMockFn<[string], Promise<User>>();
findUser.mockResolvedValue({ id: "u_1" });

clock.advance(60_000);
cleanup.register(() => container.dispose(), "container");

// Rejects with an AggregateError if any cleanup fails.
await cleanup.dispose();

Assertions compare structurally, so they can actually fail:

import { assertResponseStatus, assertResponseBody } from "@zudojs/testing";

assertResponseStatus(response, 201);
assertResponseBody(response, { id: "u_1", roles: new Set(["admin"]) });

Features

  • Test container, config, clock, and application context
  • Spy logger that records child and context loggers too
  • Mock functions, spies, and stubs
  • Recording event bus, message bus, and queue
  • HTTP request/response builders
  • Structural assertions for responses, events, errors, and serialization
  • Cleanup manager that reports what failed

Safety Notes

  • Assertions compare structurally, not by JSON.stringify. Map, Set, Date, BigInt, undefined values and key order are all handled, and a circular value reports a mismatch instead of throwing a TypeError.
  • createStub() answers then with undefined, so awaiting a stub — or returning one from an async factory — resolves rather than hanging.
  • cleanup.dispose() rejects with an AggregateError when any cleanup fails, after running them all.
  • mockResolvedValue and mockRejectedValue return promises; results stays aligned index-for-index with calls.
  • Spies forward their receiver, so a method reading this still works.

Use Cases

  • Unit and integration testing
  • Dependency injection in tests
  • Deterministic time and randomness
  • Asserting on events, messages, and HTTP responses