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

@fluixi/testing

v1.0.0-alpha.5

Published

Minimal test helpers for Fluixi components — render into jsdom, flush effects, fire events. Bring vitest + @testing-library/dom for the rest.

Readme

@fluixi/testing

Minimal helpers for testing Fluixi components. It renders a component into a jsdom container, gives you a disposer and query shorthands, and re-exports flush so you can await effects. For queries and matchers beyond the basics, reach for @testing-library/dom — it works against the DOM, so it composes with this out of the box.

Alpha. The surface here is deliberately small; richer utilities will grow from real usage.

Install

npm i -D @fluixi/testing vitest jsdom

Point vitest at jsdom:

// vitest.config.ts
import { defineConfig } from 'vitest/config';

export default defineConfig({
  test: { environment: 'jsdom', globals: true },
});

Use

import { render, flush, fireEvent } from '@fluixi/testing';
import { Counter } from './Counter';

it('increments on click', async () => {
  const { find, unmount } = render(() => <Counter start={2} />);

  expect(find('output')!.textContent).toBe('2');

  fireEvent(find('button')!, 'click');
  await flush(); // let effects settle

  expect(find('output')!.textContent).toBe('3');
  unmount();
});

API

render(code, options?) → RenderResult

Mounts code (a thunk that returns your component/element) into a container. By default it creates a <div> and appends it to document.body; pass options.container to mount elsewhere.

RenderResult:

  • container — the element rendered into.
  • unmount() — dispose the reactive root and detach the container.
  • find(selector)container.querySelector.
  • findAll(selector)container.querySelectorAll, as an array.
  • html() — the container's current innerHTML.

flush() → Promise<void>

Flushes pending reactive effects. Also exported as flushEffects.

fireEvent(node, type, init?) → boolean

Dispatches a bubbling, cancelable event. Bubbling matters — Fluixi delegates on* handlers, so a non-bubbling event won't reach them. For anything richer, use node.dispatchEvent(...) directly or @testing-library/dom's fireEvent.

SSR assertions

renderToString is re-exported for asserting server output:

import { renderToString } from '@fluixi/testing';

expect(renderToString(() => <Hello name="world" />)).toContain('world');

With @testing-library/dom

import { render } from '@fluixi/testing';
import { getByRole } from '@testing-library/dom';

const { container } = render(() => <LoginForm />);
getByRole(container, 'button', { name: /sign in/i }).click();