repo-source-code-test

Write type-safe Vitest unit tests for Formisch core packages.

1.1k|32|Updated Apr 5, 2025
One-click install
npx skills add https://github.com/open-circle/formisch --skill repo-source-code-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: repo-source-code-test
Source: https://github.com/open-circle/formisch/tree/main/skills/repo-source-code-test
Command: npx skills add https://github.com/open-circle/formisch --skill repo-source-code-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers write unit tests for Formisch core packages using proper TypeScript types, ensuring type-safety and reducing type-related regressions.

Core Features & Use Cases

  • Type-safe templates and test structures that live next to implementation in packages/core.
  • Clear guidance on avoiding type casts and using type guards for test correctness.
  • Real-world examples and templates for common core modules (form validation, field management, and state handling).

Quick Start

Use this skill to scaffold and run vitest-based unit tests for core modules:

  • Locate core implementation under packages/core/src
  • Create tests with .test.ts files following the project's conventions
  • Run the test suite: pnpm -C packages/core test

Frequently Asked Questions about repo-source-code-test

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

FAQPage Schema
How do I write type-safe unit tests for TypeScript core modules?

Type-safe unit tests for TypeScript core modules are written using Vitest and structured templates that enforce type guards, ensuring correctness without type casts. Tests are colocated next to implementation files to maintain alignment with repository conventions.

How do I avoid type casts when writing Vitest tests for form validation?

Avoiding type casts in Vitest tests for form validation requires using type-safe patterns and type guards provided by the testing templates. This enforces strict TypeScript checks to reduce type-related regressions in core modules.

Where should I place unit test files in a monorepo core package?

Unit test files in a monorepo core package should be colocated next to implementations under packages/core/src. This structured test template uses .test.ts files aligned with the repository's conventions for form validation and state handling.

Does this unit testing approach support real DOM testing for field management?

Yes, the unit testing approach supports real DOM testing for field management when required. It provides real-world examples and structured templates for common core modules using TypeScript and Vitest.

What is the best way to run Vitest unit tests for a specific core package?

The best way to run Vitest unit tests for a specific core package is executing the test suite via the command line. Running pnpm -C packages/core test executes the vitest-based unit tests scoped to that specific implementation.