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-native-testsmith

v0.1.2

Published

Local-first React Native testing CLI for Jest and Testing Library

Readme

react-native-testsmith

CI npm version License: MIT

Production-ready CLI for React Native unit testing with Jest and React Native Testing Library.

1.0.1 Update

  • Switched to API-first AI generation (Ollama removed on this branch)
  • init now runs Jest setup automatically
  • generate now runs full pipeline: scan + API check + per-file AI generation
  • Long files are chunked automatically for free-tier model limits
  • Added per-file progress logs and final generation summary counts

Why this exists

  • Automates painful Jest + RN config
  • Scans your components/screens and builds metadata
  • Generates stable test templates quickly
  • Supports API-driven AI test generation with chunking for large files

Install

npm i -g react-native-testsmith

Or inside a project:

npm i -D react-native-testsmith

For local development from this repo:

npm i
npm run build
npm i -g .
react-native-testsmith --help

If you see command not found, install globally (npm i -g .) or run with npx.

Commands

react-native-testsmith init
react-native-testsmith generate
react-native-testsmith generate --failed-only
react-native-testsmith doctor
react-native-testsmith doctor --json

Typical workflow

react-native-testsmith init
react-native-testsmith generate

Full setup steps (end-to-end)

  1. Install CLI
npm i -g react-native-testsmith
  1. Move to your React Native app
cd mobileApp
  1. Create config
react-native-testsmith init
  1. Configure Jest and required mocks
# already done by init
# optional manual run:
react-native-testsmith setup
  1. Run complete generation pipeline (scan + API check + per-file AI generation)
react-native-testsmith generate
  1. Verify setup health
react-native-testsmith doctor
react-native-testsmith doctor --json

Setup output

setup creates:

  • jest.config.js
  • jest.setup.ts
  • __mocks__/fileMock.tsx
  • __mocks__/styleMock.ts
  • RN mock shims for common libraries
  • installs @testing-library/react-native if missing

When you pass --with-native-mocks, setup also creates:

  • __mocks__/react-native-config.ts
  • __mocks__/react-native-device-info.ts
  • __mocks__/react-native-vector-icons-MaterialIcons.ts

Use --dry-run to preview all setup changes safely before writing files.

init runs setup automatically. You can still run setup directly when needed.

Test output structure

generate mirrors your source structure in __tests__ when testFileStyle is tests-dir.

Example:

  • src/components/Button.tsx -> __tests__/components/Button.test.tsx
  • src/screens/auth/Login.js -> __tests__/screens/auth/Login.test.js

API notes

  • generate is the primary AI command now (project-wide).
  • RN_TESTSMITH_API_URL overrides endpoint and RN_TESTSMITH_API_KEY is optional.
  • Long files are chunked automatically and then synthesized.
  • scan includes App.ts, App.js, App.tsx, and App.jsx at project root.
  • Terminal output includes per-file progress and final AI response/generated counts.
  • 5xx API errors/timeouts are retried automatically (configurable via env vars).
  • Failed files are stored in .react-native-testsmith/failed-files.json and can be retried with generate --failed-only.

CI

GitHub Actions CI is included at .github/workflows/ci.yml:

  • typecheck
  • build
  • test

Notes

  • Generated tests are templates and should be refined by developers.
  • Use --force if you want to overwrite existing generated files.

Sponsor request

react-native-testsmith is currently free to use.

If this project saves your team time, please sponsor development so we can:

  • maintain and improve templates faster
  • add broader framework support
  • provide optional hosted model inference in the future
  • keep docs, CI, and releases production-grade

Interested in sponsoring? Open an issue with title Sponsorship and we will coordinate.