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

@react-aria/test-utils

v1.0.0-rc.0

Published

Testing utils for react-aria patterns

Readme

@react-aria/test-utils

This package is part of react-spectrum. See the repo for more details.

See the React Aria testing docs for usage.

@react-aria/test-utils is a set of testing utilities that aims to make writing unit tests easier for consumers of React Aria or for users who have built their own components following the respective ARIA pattern specification.

Requirements: This library uses @testing-library/dom@10 and @testing-library/user-event@14. You need to be on React 18+ for these utilities to work.

Installation

npm install @react-aria/test-utils --dev

Setup

Initialize a User object at the top of your test file, and use it to create an ARIA pattern tester in your test cases. The tester has methods that you can call within your test to query for specific subcomponents or simulate common interactions.

// YourTest.test.ts
import {screen} from '@testing-library/react';
import {User} from '@react-aria/test-utils';

// Provide whatever method of advancing timers you use in your test, this example assumes Jest with fake timers.
// 'interactionType' specifies what mode of interaction should be simulated by the tester
// 'advanceTimer' is used by the tester to advance the timers in the tests for specific interactions (e.g. long press)
let testUtilUser = new User({interactionType: 'mouse', advanceTimer: jest.advanceTimersByTime});
// ...

it('my test case', async function () {
  // Render your test component/app
  render();
  // Initialize the table tester via providing the 'Table' pattern name and the root element of said table
  let table = testUtilUser.createTester('Table', {root: screen.getByTestId('test_table')});

  // ...
});

User API

class User {
  constructor(opts?: {
    interactionType?: 'mouse' | 'keyboard' | 'touch',
    advanceTimer?: (time?: number) => void | Promise<unknown>
  });

  createTester(patternName, opts): PatternTester;
}
  • interactionType — default modality used by testers created from this User. Individual testers can override this via setInteractionType or per-method options.
  • advanceTimer — used by testers to advance timers for interactions like long press. Pass jest.advanceTimersByTime (or your test framework's equivalent) when using fake timers.
  • createTester(patternName, opts) — returns a tester for the given ARIA pattern. opts.root is the root element of the component under test.

Patterns

Below is a list of the ARIA patterns supported by createTester. See the accompanying component testing docs pages on the React Aria docs site for sample usage of each tester in a test suite.