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

@tscircuit/bun-test-plan

v0.0.3

Published

Generate test plans for parallel CI execution with bun test

Readme

bun-test-plan

Create a test plan for bun test runners. Used in tscircuit projects with test matrixes to keep the CI running fast.

Installation

npm install -g @tscircuit/bun-test-plan

Usage

# Run with default settings (reads from bun-test-plan.json)
bun-test-plan

# Or specify node count via CLI
bun-test-plan --node-count 4

This generates a .bun-test-plan directory:

.bun-test-plan/
├── testplans/
│   ├── testplan1.txt
│   ├── testplan2.txt
│   ├── testplan3.txt
│   └── testplan4.txt
└── scripts/
    ├── run-tests-node1.sh
    ├── run-tests-node2.sh
    ├── run-tests-node3.sh
    └── run-tests-node4.sh

Configuration

Configure test plan generation with bun-test-plan.json in your project root:

{
  "nodeCount": 4,
  "globPatterns": [
    "tests/components/normal-components/**/*.test.tsx",
    "tests/components/primitive-components/**/*.test.tsx",
    "tests/repros/**/*.test.tsx",
    "tests/examples/**/*.test.tsx",
    "tests/**/*.test.{ts,tsx}"
  ],
  // Optional: Specify globs for specific nodes, these globs are guaranteed to run on your specificed node
  "nodes": [
    {
      "nodeIndex": 0,
      "name": "Bug Reports 0-9",
      "globPatterns": ["tests/bugreports/bugreport0*.test.tsx"]
    }
  ]
}

Configuration Options

| Option | Type | Description | |--------|------|-------------| | nodeCount | number | Number of parallel CI nodes to distribute tests across | | globPatterns | string[] | Array of glob patterns to match test files (order matters!) |

GitHub Workflow Example

name: Bun Test

on:
  pull_request:
  push:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    strategy:
      matrix:
        node: [1, 2, 3, 4]

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Setup bun
        uses: oven-sh/setup-bun@v2
        with:
          bun-version: latest

      - name: Install dependencies
        run: bun install

      - name: Generate test plans
        run: bunx @tscircuit/bun-test-plan

      - name: Run tests for node ${{ matrix.node }}
        run: |
          TESTPLAN_FILE=".bun-test-plan/testplans/testplan${{ matrix.node }}.txt"

          if [ ! -f "$TESTPLAN_FILE" ]; then
            echo "ERROR: No test plan found for node ${{ matrix.node }}"
            exit 1
          fi

          mapfile -t test_files < "$TESTPLAN_FILE"
          if [ ${#test_files[@]} -eq 0 ]; then
            echo "ERROR: No test files in plan for node ${{ matrix.node }}"
            exit 1
          fi

          echo "Running ${#test_files[@]} test files for node ${{ matrix.node }}"
          bun test ${test_files[@]}

      - name: Upload Snapshot Artifacts on Failure
        if: failure()
        uses: actions/upload-artifact@v4
        with:
          name: snapshots-node${{ matrix.node }}
          path: |
            tests/**/__snapshots__/*.diff.png
            tests/**/__snapshots__/*.snap.png
          if-no-files-found: ignore

Test Plan File Format

Each testplan{N}.txt contains a list of test file paths, one per line:

tests/components/normal-components/chip.test.tsx
tests/components/normal-components/resistor.test.tsx
tests/unit/my-func.test.ts
tests/examples/basic-circuit.test.tsx

Run Script Example

Each run-tests-node{N}.sh script handles test execution:

#!/usr/bin/env bash

TESTPLAN_FILE=".bun-test-plan/testplans/testplan1.txt"

if [ ! -f "$TESTPLAN_FILE" ]; then
  echo "ERROR: Test plan not found: $TESTPLAN_FILE"
  exit 1
fi

mapfile -t test_files < "$TESTPLAN_FILE"

if [ ${#test_files[@]} -eq 0 ]; then
  echo "ERROR: No test files in plan"
  exit 1
fi

echo "Running ${#test_files[@]} test files..."
bun test ${test_files[@]}

Tips

  • Add .bun-test-plan/ to your .gitignore, they are generated prior to running tests.
  • Adjust nodeCount based on your CI runner capacity and test suite size