caliber-testing

Standardize Vitest test structure, mocks, and environment handling for Caliber projects.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/Buckeyes22/weather-app --skill caliber-testing-buckeyes22
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: caliber-testing
Source: https://github.com/Buckeyes22/weather-app/tree/main/docs/corpora/caliber/skills/caliber-testing
Command: npx skills add https://github.com/Buckeyes22/weather-app --skill caliber-testing-buckeyes22

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Caliber Testing standardizes Vitest test patterns to ensure consistent, reliable tests across projects by providing a reusable blueprint for mocks, env handling, and test structure.

Core Features & Use Cases

  • Enforces test location and structure: tests directories adjacent to source code.
  • Provides global LLM mock usage from src/test/setup.ts to avoid bespoke mocks.
  • Establishes environment variable safety with beforeEach/afterEach to prevent pollution.
  • Encourages ES module imports with .js extensions and standardized file naming [module].test.ts.

Quick Start

Write tests following Caliber patterns by placing [module].test.ts inside tests adjacent to source.

Frequently Asked Questions about caliber-testing

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

FAQPage Schema
How do I standardize Vitest test structure across my projects?

Standardizing Vitest tests requires placing files in a __tests__ directory adjacent to source code and naming them with the [module].test.ts pattern to ensure consistent organization and discoverability.

How do I prevent environment variable pollution in Vitest tests?

To prevent environment variable pollution in Vitest, wrap any environment changes using beforeEach and afterEach hooks so variables are reset after each test run.

What is the best way to mock modules in Vitest?

The best way to mock modules in Vitest is using hoisted vi.mock() at the top of files and relying on the global mock configured in src/test/setup.js to avoid bespoke mock definitions.

Why do my ES module imports fail in Vitest?

ES module imports fail in Vitest when missing file extensions; standardizing imports by explicitly including the .js extension resolves path resolution issues during test execution.

Does Caliber testing work without bespoke mocks?

Yes, Caliber testing works without bespoke mocks by relying on a global LLM mock established in src/test/setup.js, ensuring consistent behavior across your test suite without manual setup.