Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a44d70c
docs: add documentation website
mdjastrzebski Dec 3, 2026
7da342f
docs: add runner picker with logos to quick start
mdjastrzebski Dec 3, 2026
e3ea3c5
docs: order package manager tabs bun, pnpm, yarn, npm without deno
mdjastrzebski Dec 3, 2026
2fd56f6
docs: use one runner picker for the whole quick start setup
mdjastrzebski Dec 3, 2026
06f68b6
docs: drop the runner picker hint from quick start
mdjastrzebski Dec 3, 2026
3ee9ace
docs: put the runner picker right below the setup heading
mdjastrzebski Dec 3, 2026
415e743
docs: shorten the intro, compare with e2e tests and recommend vitest
mdjastrzebski Dec 3, 2026
0aff2d7
ci: publish the docs website to github pages
mdjastrzebski Dec 3, 2026
742e5b7
fix: check the react that test-renderer and the nitro-ui packages res…
mdjastrzebski Dec 3, 2026
b987bfb
docs: keep root and container live in the custom render recipe
mdjastrzebski Dec 3, 2026
8ef9612
docs: nest the caller's wrapper in the custom render recipe
mdjastrzebski Dec 3, 2026
49f7e68
docs: add the missing imports to cookbook snippets
mdjastrzebski Dec 3, 2026
726606a
docs: say fake timers still need a long enough waitFor timeout
mdjastrzebski Dec 3, 2026
cab9b83
docs: declare tab constants before the components that read them
mdjastrzebski Dec 3, 2026
1845a3a
docs: resolve the global stylesheet path with fileURLToPath
mdjastrzebski Dec 3, 2026
f7d8dc3
docs: link edit page to GitHub's editor
mdjastrzebski Dec 3, 2026
25515bd
docs: look up React for the installed nitro-ui-renderer version
mdjastrzebski Dec 3, 2026
f1b8e81
tweak
mdjastrzebski Dec 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,21 @@
- run: bun install --frozen-lockfile
- run: bun run format:check

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: package.json
- run: bun install --frozen-lockfile
# Typechecks the config and builds the site, which fails on dead links.
- run: bun run docs:build

# Tests run against two NitroUI versions: the one pinned in `bun.lock`, and
# NitroUI's latest release. A `latest` failure means a new NitroUI release
# needs support before we raise the pinned version.
test:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
strategy:
fail-fast: false
matrix:
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Docs

# Builds the website and publishes it to GitHub Pages on every push to `main`.
# CI's `docs` job already checks that the site builds on PRs.
on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

# One deploy at a time. A newer push waits, but never cancels a running deploy.
concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: package.json
- run: bun install --frozen-lockfile
- run: bun run docs:build
- uses: actions/configure-pages@v6
- uses: actions/upload-pages-artifact@v5
with:
path: website/build

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v5
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ coverage/

# Local agent settings
.claude/settings.local.json

# Website
website/build/
27 changes: 22 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ The repo is a Bun workspace monorepo. More packages are coming.
break on npm. A new package writes its own short README and copies only
`LICENSE`.
- `examples/*`: private apps that use the built packages like an app would.
- `website`: the private documentation site, built with
[Rspress](https://rspress.rs) and the Callstack theme
(`@callstack/rspress-theme`). Its pages are in `website/docs/`, shaped
like React Native Testing Library's docs: Getting started, API reference,
Guides, Advanced Guides and a Cookbook. Each folder's `_meta.json` sets the
sidebar order, and `_nav.json` the top navigation. It's a separate
workspace, not part of a package, so its dependencies stay out of the
library and `--filter './packages/*'` skips it.
- The root is private. It holds the shared tooling (oxfmt, release-it, CI,
`scripts/`) and the release version, and its scripts run each task across
the packages with `bun run --filter`.
Expand All @@ -47,8 +55,10 @@ reviewed steps, rather than copying it wholesale.
code for older NitroUI versions.
- **React:** pin the devDependency to the exact version `nitro-ui-renderer`
depends on (currently 19.3.0). A second React copy breaks hooks. After
changing dependencies, check that `node_modules/.bun` has only one `react@`
entry.
changing dependencies, check that the library, the example app and
`nitro-ui-renderer` resolve the same React (`scripts/use-latest-nitro-ui.sh`
checks this). The website has its own React (Rspress needs a newer one),
which is fine because it never loads NitroUI.
- **test-renderer:** 1.3.2 or newer, the first release with the
`createRefValue` root option and `TestInstance.refValue`.

Expand Down Expand Up @@ -78,7 +88,12 @@ scripts (`build`, `typecheck`, `test`, `test:jest`, `test:vitest`,
runner, use `bun run test:jest`, `bun run test:vitest` or `bun run test:bun`.
Plain `bun test` works only in a package's directory, where its
`bunfig.toml` sets the preload.
- Run every check (format, typecheck, tests, example app): `bun run validate`.
- Docs: `bun run docs:dev` starts the website locally, and `bun run docs:build`
typechecks its config and builds it to `website/build/`. The build fails on
dead links. When you change the public API, update the matching pages in
`website/docs/` and the root `README.md` in the same change.
- Run every check (format, typecheck, tests, example app, docs build):
`bun run validate`.
- Release with `bun run release` ([release-it](https://github.com/release-it/release-it),
`.release-it.json`): it runs `validate`, bumps the version, builds, writes
the changelog from Conventional Commits, publishes to npm, tags and creates
Expand All @@ -92,11 +107,13 @@ scripts (`build`, `typecheck`, `test`, `test:jest`, `test:vitest`,
- CI runs on GitHub Actions. The test jobs live in the reusable
`.github/workflows/test.yml`, one job each for typecheck, `bun test`, and
Jest and Vitest on Node 24.
- `ci.yml` (pushes to `main` and PRs) runs the format check, then the tests
twice: against the NitroUI version pinned in `bun.lock`, and against
- `ci.yml` (pushes to `main` and PRs) runs the format check and the docs
build, then the tests twice: against the NitroUI version pinned in `bun.lock`, and against
NitroUI's latest release (`scripts/use-latest-nitro-ui.sh`).
- `nightly.yml` runs the tests against NitroUI's latest release every night,
so a new release is caught even when nothing is pushed.
- `docs.yml` builds the website and publishes it to GitHub Pages on every
push to `main`, at `https://oss.callstack.com/nitro-ui-testing-library/`.
- To try a specific NitroUI version locally, run
`NITRO_UI_VERSION=x.y.z ./scripts/use-latest-nitro-ui.sh`, then revert
the `package.json` files and `bun.lock`. Add new packages that depend on
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Peer dependencies: `nitro-ui-renderer` (>= 0.3.0) and `react` (^19.3.0, the vers

## 🏃 Test runners

Vitest, Bun test and Jest are all supported. Add the setup entry for your runner. It mocks NitroUI's native modules, cleans up after each test and adds the custom matchers.
Vitest, Bun test and Jest are all supported. Vitest is the recommended runner for now. Bun test still lacks a few things, such as snapshot formatting, which should improve over time. Add the setup entry for your runner. It mocks NitroUI's native modules, cleans up after each test and adds the custom matchers.

**Vitest** (`vitest.config.ts`):

Expand Down Expand Up @@ -122,7 +122,8 @@ This repo is a monorepo. The library lives in [`packages/testing-library`](https
```sh
bun install
bun run test # Jest, Vitest and bun test, in every package
bun run validate # format, typecheck, tests and the example app
bun run validate # format, typecheck, tests, the example app and the docs
bun run docs:dev # the documentation site, from website/
```

See [`AGENTS.md`](https://github.com/callstack/nitro-ui-testing-library/blob/main/AGENTS.md) for more on the repo's setup.
Expand Down
Loading