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

@textui/testing

v0.5.0

Published

Headless testing harness for TextUI - semantic queries, input, resizing, time

Readme

@textui/testing

npm license

A headless harness for TextUI applications. No terminal, no timers, no snapshots of a screen nobody looked at.

npm install --save-dev @textui/testing
import { renderApp } from '@textui/testing';

const t = await renderApp(<App />, { width: 80, height: 24 });

expect(t.getByRole('button', { name: 'Save' }).focused).toBe(true);
t.press('enter');
await t.settle();
expect(t.text()).toContain('Saved');

Query by what it is, not where it is

Every component declares a semantic role, so a test asks the way a person would - the Save button, the row labelled api - rather than by index into a tree that changes the moment the layout does.

| | | |---|---| | getByRole(role, { name }) | The one with that role and accessible name | | getByLabel / getByText | By label, or by rendered text | | getByComponent(name) | The escape hatch, when the role is not the point | | text(), line(y), lines() | What is actually on the screen | | tree() | The instance tree, for when the pixels are not the question |

An Element is a description - role, label, text, rect, focus, props - not a handle. You act on the application with keys, the way a person does.

get* throws with the near misses listed; query* returns null.

Drive it, then let it settle

press('ctrl+s'), pressAll('down', 'down', 'enter'), type('hello'), and resize(w, h). Effects and re-renders are asynchronous, so await t.settle() is what separates "I sent the key" from "the screen caught up".

Test at two sizes

A single fixed size skips every breakpoint and hides the layout break you were trying to catch. resize is cheap, and a loop over two sizes costs one line:

for (const size of [{ width: 100, height: 30 }, { width: 60, height: 18 }]) {
  it(`fits at ${size.width}x${size.height}`, async () => { /* ... */ });
}

Runtime

Depends on @textui/core and @textui/terminal. No node: imports - it runs on the virtual terminal, so there is no tty to have. Node 22+ and Bun.

Documentation

https://softov.github.io/textui/


Part of TextUI - documentation - getting started

@textui/kit one install · @textui/core the runtime · @textui/widgets the catalog · @textui/terminal adapters and input · @textui/testing the harness · @textui/cli the CLI