solidjs-testing

Test SolidJS components and primitives with Vitest and @solidjs/testing-library.

Updated Apr 21, 2026
One-click install
npx skills add https://github.com/gregoryraymond/claude-agents-and-skills --skill solidjs-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: solidjs-testing
Source: https://github.com/gregoryraymond/claude-agents-and-skills/tree/main/skills/solidjs-testing
Command: npx skills add https://github.com/gregoryraymond/claude-agents-and-skills --skill solidjs-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing and maintaining SolidJS tests manually leads to flaky results, missed edge cases, and slower development cycles.

Core Features & Use Cases

  • Vitest-based testing with @solidjs/testing-library for SolidJS components.
  • Support for testing primitives via renderHook, context providers, and router wrappers.
  • Examples and guidelines for async testing with Suspense and mocked data.

Quick Start

Install dependencies and run the test suite with vitest to begin validating SolidJS components.

Frequently Asked Questions about solidjs-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test SolidJS components with Vitest and @solidjs/testing-library?

Test SolidJS components by configuring Vitest with @solidjs/testing-library to render elements and validate DOM behavior in jsdom. This setup catches bugs fast by applying unit and integration tests directly to your components and primitives.

Can I test SolidJS primitives and hooks using renderHook?

Yes, you can test SolidJS primitives using the renderHook method provided by @solidjs/testing-library. It allows you to evaluate primitive logic independently, ensuring your custom hooks function correctly within the SolidJS reactive system.

What is the best way to test async SolidJS components with Suspense?

The best way to test async SolidJS components with Suspense is using Vitest alongside @solidjs/testing-library. This approach supports Suspense scenarios and mocked data, allowing you to validate asynchronous rendering and edge cases reliably.

Does testing SolidJS router context require special wrappers?

Yes, testing SolidJS router context requires applying router-context wrappers around your components during tests. Using @solidjs/testing-library with Vitest ensures that components relying on routing parameters behave correctly within the simulated jsdom environment.

Why are my SolidJS tests flaky when running in jsdom?

SolidJS tests become flaky in jsdom when reactive updates, Suspense boundaries, or context providers are not properly wrapped. Using @solidjs/testing-library with Vitest applies the correct mocks and wrappers to stabilize DOM testing and catch bugs consistently.