unit-test

Generate Bun-based unit tests for RestMan code with TypeScript strict mode.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/cadamsdev/restman --skill unit-test-cadamsdev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unit-test
Source: https://github.com/cadamsdev/restman/tree/main/.opencode/skills/unit-test
Command: npx skills add https://github.com/cadamsdev/restman --skill unit-test-cadamsdev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Writing and maintaining comprehensive unit tests for RestMan code can be tedious without a standardized approach and tooling.

Core Features & Use Cases

  • Test File Creation: generate properly named test files (e.g., *.test.ts, *_test.ts, *.spec.ts, *_spec.ts) with TypeScript types guided by bun:test.
  • Bun Test Framework Features: covers basic tests, lifecycle hooks, mocking, snapshot testing, and concurrent/serial tests.
  • RestMan-Specific Testing Guidelines: enforce TypeScript strict mode, mock filesystem and UI interactions, and validate error handling.
  • Running Tests: provide commands to run bun test, watch for changes, and generate coverage.

Quick Start

Create a new test file for your target module using a *.test.ts extension and run bun test to verify all tests pass.

Frequently Asked Questions about unit-test

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

FAQPage Schema
How do I write Bun unit tests for RestMan?

Create Bun unit tests for RestMan by generating TypeScript test files with bun:test types, mocking external dependencies, and executing the suite with bun test to verify behavior and generate coverage.

How do I mock external dependencies in Bun test files?

Mock external dependencies in Bun test files by using the framework's built-in mocking features to isolate filesystem and UI interactions, ensuring your RestMan modules are tested without relying on external systems.

What file naming conventions should I use for Bun test files?

Name your Bun test files using *.test.ts, *_test.ts, *.spec.ts, or *_spec.ts extensions so the bun test runner automatically discovers and executes your RestMan test suites.

Does this testing approach enforce TypeScript strict mode?

Yes, this testing approach enforces TypeScript strict mode across your RestMan test files, ensuring type safety and robust validation when defining mocks, lifecycle hooks, and test cases with bun:test.

How do I run Bun tests and generate coverage for RestMan modules?

Run Bun tests and generate coverage for RestMan modules by executing the bun test command in your terminal, which provides options to watch for file changes and output coverage reports.

What Bun test framework features are available for RestMan testing?

Available Bun test framework features for RestMan testing include basic assertions, lifecycle hooks, mocking, snapshot testing, and concurrent or serial test execution to validate module behavior comprehensively.