server-testing

Run and debug server tests with Vitest for routers, services, and models.

1|Updated Nov 19, 2025
One-click install
npx skills add https://github.com/CatOfJupit3r/ultimate-starter --skill server-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: server-testing
Source: https://github.com/CatOfJupit3r/ultimate-starter/tree/main/.github/skills/server-testing
Command: npx skills add https://github.com/CatOfJupit3r/ultimate-starter --skill server-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Write and run tests for the server using Vitest. Prefer integration tests for features and use unit tests only for utilities and helpers. Use when creating tests for routers, services, models, implementing test utilities, debugging test failures, or running tests. Includes guidance on the "accessed before declaration" error which indicates errors in the CODE being tested, not the test itself.

Core Features & Use Cases

  • Integration-focused testing guidance for servers built with Vitest, including routers, services, and models.
  • Fixture-driven test utilities to create reproducible scenarios and validate end-to-end behavior.
  • Best-practice workflows for debugging failures and diagnosing "accessed before declaration" errors.

Quick Start

Start by running the test suite locally and inspecting integration fixtures to understand end-to-end testing patterns.

Frequently Asked Questions about server-testing

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

FAQPage Schema
How do I write integration tests for server routers and services using Vitest?

To write integration tests using Vitest, adopt a fixture-first approach to create reproducible scenarios and use oRPC's call() function to invoke routers with type safety. This method validates end-to-end behavior across routers, services, and models.

What is the best way to structure Vitest test suites for server-side applications?

The best way to structure Vitest test suites is by prioritizing integration tests for features and reserving unit tests for utilities. You should enforce clear test organization with strict isolation and cleanup to maintain reliable end-to-end server behavior validation.

Why does my Vitest test suite fail with an "accessed before declaration" error?

An "accessed before declaration" error in Vitest indicates a bug in the code being tested, not the test itself. You should debug the underlying server code implementation rather than inspecting your test assertions or test organization for the failure.

Can I use Vitest to debug server test failures and validate end-to-end behavior?

Yes, you can use Vitest to debug server test failures by running the suite locally and inspecting integration fixtures. This workflow helps diagnose errors in the tested code and validates end-to-end behavior using reproducible test scenarios.

When should I use unit tests versus integration tests for server testing?

You should use integration tests for server features like routers, services, and models, and reserve unit tests only for testing utilities and helpers. This ensures comprehensive validation of end-to-end behavior while keeping isolated logic tests maintainable.