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

@exactjs/testing

v0.7.0

Published

Runner-neutral tools for testing eXact components and server behavior.

Readme

@exactjs/testing

Runner-neutral tools for testing eXact components and server behavior.

Component tests

import { testComponent } from '@exactjs/testing';

const view = await testComponent(Counter).props({ step: 2 }).mount();
await view.getByRole('button').click();

expect(view.root.state()).toMatchObject({ count: 2 });
view.unmount();

The mounted view provides accessible role and text queries, settled user events, component state and context inspection, and DOM-focused matchers.

Tests that exercise compiler-emitted plugin markers can pass the application bundle's local enhancementCatalog through .configure() or mountTest() options. The mount helper activates the enhancement renderer only when that option is present, so ordinary component tests retain the enhancement-free DOM entry point.

Server and client/server tests

Use testServerComponent() with a compiled .exact.server artifact to render and inspect server components. Captures retain settled state, props, context and parent/child relationships after server cleanup, including stateless components and repeated uses of the same component. Use mountClientServerTest() to hydrate generated client islands against an in-memory request handler and record protocol exchanges without depending on generated operation IDs. By default, mount waits for eager lazy islands to finish loading and adopting before returning. Load failures reject mount. Interaction-deferred islands stay dormant until activated. hydratedIslands reflects the current hydration observations.

Pass the production registration's islands to mountClientServerTest() and spread the full registration into hydrate, including generated continuation contracts when they are omitted from SSR HTML. Keep the SSR renderer import in a compiled application or fixture module to retain optional enhancement integration. For multi-stage tasks, poll for the final page state before unmounting.

Pending work and progress

For startup progress, pass settleTasks: false to mountClientServerTest(). It returns without waiting for client tasks or island loads. Wait for the expected control or intermediate state before interacting. Event helpers also accept { settleTasks: false } to observe pending work.

A controlled test service can hold completion until the test has asserted a progress update, then release the result and await view.settle(). Consumed protocol lines appear incrementally in view.protocol.exchanges[n].response.events. Progress snapshots may be coalesced, so assertions should describe meaningful state rather than requiring every producer report to arrive. Always call view.unmount() during cleanup, including when an assertion fails.

Test runners

Most projects should use @exactjs/vitest, @exactjs/jest, or @exactjs/bun-test. These packages configure compilation, DOM globals, and matchers for their runner.

Low-level framework tests may import @exactjs/testing/internal/fixtures to construct low-level native operations. Application tests should compile authored components normally.

Documentation | Source on GitHub