test-module

Automate TanStack React Module testing with renderModule, resolveModule, and createMockStore.

1|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/kibertoad/tanstack-react-modules --skill test-module
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-module
Source: https://github.com/kibertoad/tanstack-react-modules/tree/main/skills/test-module
Command: npx skills add https://github.com/kibertoad/tanstack-react-modules --skill test-module

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manual testing of TanStack React Modules is tedious and error-prone; this skill automates tests by providing utilities like renderModule, resolveModule, and createMockStore to simulate modules in isolation.

Core Features & Use Cases

  • Testing route-based modules with isolated rendering
  • Testing component-only modules and slot contributions
  • Verifying lifecycle hooks and dependency wiring in tests

Quick Start

Create a test file next to the module and run vitest to execute tests.

Frequently Asked Questions about test-module

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

FAQPage Schema
How do I test TanStack React modules in isolation?▼

To test TanStack React modules in isolation, you can use testing utilities like renderModule, resolveModule, and createMockStore to simulate module dependencies and render components independently.

How do I verify lifecycle hooks and slot contributions in React module tests?▼

Verifying lifecycle hooks and slot contributions in React module tests is done by rendering component-only modules with isolated testing utilities to check dependency wiring and validate slot outputs.

Does Vitest work with Testing Library for mocking React module dependencies?▼

Yes, Vitest works with Testing Library to mock React module dependencies by using createMockStore and resolveModule to provide isolated test environments for route-based and headless modules.

What is the best way to test route-based React modules without manual setup?▼

The best way to test route-based React modules without manual setup is automating tests with dedicated utilities that handle isolated rendering, dependency mocking, and lifecycle verification.

Do I need a SKILL.md file to test headless React modules?▼

Yes, you need a SKILL.md file with frontmatter containing a name and description to identify the module, while Vitest and Testing Library handle the actual validation and isolation.

Can I test headless modules using createMockStore and resolveModule?▼

Yes, you can test headless modules using createMockStore and resolveModule to simulate dependencies, enabling isolated rendering and dependency wiring verification without full component rendering.