logic-testing

Test pure logic and math functions in isolation using Vitest.

2|Updated Nov 28, 2025
One-click install
npx skills add https://github.com/joshribakoff/surfsim --skill logic-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: logic-testing
Source: https://github.com/joshribakoff/surfsim/tree/main/.claude/skills/logic-testing
Command: npx skills add https://github.com/joshribakoff/surfsim --skill logic-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tests pure logic and math functions in isolation using Vitest.

Core Features & Use Cases

  • Single-point assertions on functions, state transitions, and basic physics calculations.
  • Tests live next to source files to ensure maintainability and quick feedback.
  • Guidance for test utilities and time-evolution scenarios (see matrix-data-model-progression-testing for advanced cases).

Quick Start

Write a focused unit test for a single function and run it with Vitest for immediate feedback.

Frequently Asked Questions about logic-testing

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

FAQPage Schema
How do I test pure math and logic functions in isolation with Vitest?

You test pure logic and math functions by applying single-point assertions with Vitest, placing test files next to your TypeScript source modules to ensure maintainability and quick deterministic feedback.

How do I verify state transitions and basic physics calculations in TypeScript?

You verify state transitions and basic physics calculations by writing focused unit tests that assert single-point deterministic results across your TypeScript modules using Vitest.

Where should I place my Vitest unit test files for TypeScript logic testing?

For logic testing, you should colocate your Vitest test files directly next to your TypeScript source files to ensure maintainability and provide quick feedback during development.

Can I use Vitest for deterministic unit testing of state transitions without external dependencies?

Yes, you can use Vitest for deterministic unit testing of state transitions and math functions without external dependencies, applying conventional test utilities patterns to verify isolated TypeScript modules.

What is the best way to structure unit tests for pure math functions in TypeScript?

The best way to structure unit tests for pure math functions is to write focused single-point assertions using Vitest, keeping the tests colocated with the source code to maintain quick feedback loops.

How do I handle time-evolution scenarios when unit testing logic with Vitest?

For time-evolution scenarios during logic testing with Vitest, this Skill provides guidance on test utilities, while recommending matrix-data-model-progression-testing for handling advanced cases.