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

bugsbasters

v0.3.0

Published

Fast, simple testing library with Rust-powered performance

Readme

BugsBasters

A fast, simple testing library with Rust-powered performance and a clean JavaScript/TypeScript API.

Features

  • Fast - Rust core with parallel test execution via Rayon
  • Simple API - Clean, intuitive test syntax inspired by Jest
  • Beautiful Reports - Terminal colors, HTML reports, JUnit XML
  • Powerful Mocking - Simple mock() and spy() functions
  • Snapshot Testing - Capture and compare output snapshots
  • Watch Mode - Auto-run tests on file changes
  • Code Coverage - Built-in V8 coverage support
  • CI Ready - Auto-detects GitHub Actions, GitLab CI, etc.

Installation

npm install bugsbasters

Quick Start

import { test, expect, describe } from 'bugsbasters';

describe('Math', () => {
  test('adds numbers correctly', () => {
    expect(1 + 1).toBe(2);
  });

  test('multiplies numbers', () => {
    expect(3 * 4).toEqual(12);
  });
});

Run tests:

npx bugsbasters run

API

Test Functions

test('name', () => { /* test code */ });
test.skip('skipped test', () => { });
test.only('only this test runs', () => { });
test.todo('not implemented yet');

// Parameterized tests
test.each([[1, 1, 2], [2, 3, 5]])('adds %d + %d = %d', (a, b, sum) => {
  expect(a + b).toBe(sum);
});

// Test suites
describe('Suite', () => {
  beforeEach(() => { /* setup */ });
  afterEach(() => { /* cleanup */ });
  test('...', () => { });
});

Assertions

expect(value).toBe(4);                    // strict equality
expect(obj).toEqual({ a: 1 });            // deep equality
expect(arr).toContain(2);                 // contains
expect(arr).toHaveLength(3);              // length
expect(fn).toThrow('error');              // throws
expect(value).toBeTruthy();               // truthy
expect(value).toBeFalsy();                // falsy
expect(value).toBeNull();                 // null
expect(value).toBeDefined();              // defined
expect(value).toBeGreaterThan(5);         // comparison
expect(value).toBeLessThan(10);           // comparison
expect(str).toMatch(/pattern/);           // regex match
expect(obj).toHaveProperty('key', value); // property
expect(obj).toMatchObject({ a: 1 });      // partial match
expect(promise).toResolve();              // async
expect(promise).toReject();               // async

// Negation
expect(value).not.toBe(4);

Mocking

import { mock, spy } from 'bugsbasters';

// Create mock function
const fn = mock();
fn(1, 2);
expect(fn).toHaveBeenCalled();
expect(fn).toHaveBeenCalledWith(1, 2);
expect(fn).toHaveBeenCalledTimes(1);

// Return values
const fn = mock().returns(42);
const fn = mock().resolves(data);
const fn = mock().rejects(error);
const fn = mock().throws(error);

// Spy on existing method
const spy = spy(object, 'method').returns(10);
spy.restore(); // restore original

Snapshot Testing

// Capture output as snapshot
expect(data).toMatchSnapshot();

// First run creates the snapshot file
// Subsequent runs compare against it

Update snapshots:

npx bugsbasters run --update-snapshots

Watch Mode

Automatically re-run tests when files change:

npx bugsbasters watch

Keyboard shortcuts in watch mode:

  • Enter - Re-run tests
  • u - Update snapshots
  • a - Run all tests
  • q - Quit

Code Coverage

Collect coverage data:

npx bugsbasters run --coverage

CLI Options

bugsbasters run [pattern]

Options:
  -p, --parallel         Run tests in parallel (default: true)
  --no-parallel          Run tests sequentially
  -r, --reporter <type>  Reporter: terminal, html, json, junit
  -o, --output <file>    Output file for report
  --root <dir>           Root directory for test discovery
  -t, --timeout <ms>     Test timeout (default: 5000)
  -u, --update-snapshots Update snapshot files
  --coverage             Collect code coverage

bugsbasters watch [pattern]

Options:
  --root <dir>           Root directory
  -t, --timeout <ms>     Test timeout
  --no-clear             Don't clear screen between runs

Reporters

Terminal (default)

  BugsBasters v0.1.0

  ✓ adds numbers correctly         2ms
  ✓ subtracts correctly            1ms
  ✗ divides by zero               3ms

    Expected: Error("Cannot divide by zero")
    Received: 0

  Tests: 2 passed, 1 failed (3)
  Time:  127ms

HTML Report

npx bugsbasters run --reporter html

Generates a clean, single-file HTML report.

JUnit XML

npx bugsbasters run --reporter junit -o results.xml

Building from Source

Prerequisites

  • Node.js 18+
  • Rust 1.70+
  • npm or pnpm

Build

# Install dependencies
npm install

# Build TypeScript
npm run build

# Build native module (requires Rust)
npm run build:native

Architecture

bugsbasters/
├── crates/
│   ├── bugsbasters-core/    # Rust: test engine, reports, CI
│   └── bugsbasters-napi/    # Rust: Node.js bindings (NAPI-RS)
├── packages/
│   └── bugsbasters/         # JS/TS: API wrapper + CLI
└── templates/               # HTML report templates

License

MIT