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

@guren/testing

v1.14.1

Published

Testing utilities for Guren applications: TestApp with HTTP and Inertia assertions, plus auth, mail, queue and event fakes for bun:test.

Readme

@guren/testing

Testing utilities for Guren applications: TestApp with HTTP and Inertia assertions, plus fakes for auth, mail, queues, events, and AI agents. Runs on bun test.

bun add -d @guren/testing

Scaffolded apps already depend on it.

Testing a controller

import { describe, test, beforeAll } from 'bun:test'
import { TestApp } from '@guren/testing'

describe('PostController', () => {
  let app: TestApp

  beforeAll(async () => {
    app = await TestApp.create()
  })

  test('lists posts', async () => {
    await app.get('/posts').assertOk()
  })

  test('creates a post', async () => {
    await app
      .post('/posts', { title: 'Hello', content: 'World' })
      .assertStatus(201)
      .assertJsonPath('post.title', 'Hello')
  })

  test('returns 404 for a missing post', async () => {
    await app.get('/posts/999').assertNotFound()
  })
})

TestApp.create() assembles an app from the parts you pass, which suits an isolated slice but can drift from what the server actually runs. To exercise the real configuration, wrap the app your project exports:

import app from '../src/app.js'

const http = await TestApp.fromApp(app)
await http.get('/').assertOk()

Fakes

Each one swaps a subsystem for an inspectable double, so a test asserts on what the app tried to do rather than on a side effect. fakeEvent(), fakeMail() and fakeQueue() are bound on the app with app.container.fake(), inside the test that needs them, and each binding wants the shape that subsystem resolves: the testing guide gives the exact form for each, and the error you get when a fake is bound one level off.

| Fake | Asserts on | |------|-----------| | fakeMail() | Mailables that would have been sent | | fakeQueue() | Jobs that would have been dispatched | | fakeEvent() | Events that would have been dispatched |

Two more are methods on TestApp, because they change how the request itself is made:

await app.actingAs(user).get('/dashboard').assertOk()   // authenticated request
using ai = app.fakeAi()                                  // script an in-process AI agent

Subpath exports

| Import | Contents | |--------|----------| | @guren/testing/vitest | The same helpers for React component tests running under Vitest |

Documentation

The testing guide covers controller, model, event, job, mail, and notification tests.

License

MIT