Install any skill in seconds. Free to start, no credit card required.
Get Started Free →caliber-ai-org/caliber-testing
Writes Vitest tests following project patterns: __tests__/ directories, vi.mock() for module mocking with vi.hoisted() for test-time factories, global LLM mock from src/test/setup.ts, environment variable save/restore in beforeEach/afterEach, vi.clearAllMocks() lifecycle, and test file organization.
Passed 20 of 22 test cases with the skill, and 7 of 22 without it.
and 18 more in the full report
14 fixed6 passed either way1 still failing1 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 14 test cases the skill fixed. Same model, same prompt, with and without the skill.
What command should be executed prior to committing code to verify project test coverage standards?
| Checked | Without skill | With skill |
|---|---|---|
| Recommends running pnpm test:coverage | Missed | Passed |
The instructions your model reads when the skill loads.
__tests__/ directories parallel to source files: src/[module]/__tests__/[module].test.ts__tests__/ directories in vitest.config.ts's include glob (already configured: src/**/*.test.ts)src/test/setup.ts — it is the global LLM provider mock already applied to all testsprocess.env in beforeEach, restore in afterEach, and explicitly delete env vars to test absenceafterEach, not in individual test cleanup. Use fs.rmSync(dir, { recursive: true, force: true })vi.unmock('../module.js') BEFORE the import statementpnpm test locally and pnpm test:coverage before committing to verify coverage thresholds (lines: 50, functions: 50, branches: 50, statements: 50)Create src/[module]/__tests__/[module].test.ts. The parent source file is src/[module]/[module].ts.
Verify: The __tests__ directory exists at the same level as the source file being tested.
At the top of every test file, import from vitest:
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
Add additional imports based on what you're testing:
import fs from 'fs'; import path from 'path'; import os from 'os';fs.mkdtempSync(path.join(os.tmpdir(), 'caliber-prefix-'))import { execSync } from 'child_process';Verify: All required test utilities are imported before test definitions.
If testing a module that imports other modules you want to mock:
vi.mock('../config.js', () => ({
loadConfig: vi.fn(),
writeConfigFile: vi.fn(),
}));
test cases passed, vs 7 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.