Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generates Vitest unit tests for JavaScript and TypeScript, covering mocks, spies, and vitest.config setup.
91% 95%+5 ptsof test cases passed
Passed 21 of 22 test cases with the skill, and 20 of 22 without it.
This test ran on v1. v2 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
Not used yet
Use this skill when you need generates Vitest tests in JavaScript/TypeScript with Vite-native speed. Jest-compatible API with ESM support and HMR. Use when user mentions "Vitest", "vi.mock", "vitest.config". Triggers on: "Vitest", "vi.mock", "vi.fn", "Vite test", "vitest config".
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { Calculator } from './calculator';
describe('Calculator', () => {
let calc: Calculator;
beforeEach(() => { calc = new Calculator(); });
it('adds two numbers', () => {
expect(calc.add(2, 3)).toBe(5);
});
it('throws on divide by zero', () => {
expect(() => calc.divide(10, 0)).toThrow();
});
});
import { vi } from 'vitest';
// Mock module
vi.mock('./database', () => ({
getUser: vi.fn().mockResolvedValue({ name: 'Alice' }),
saveUser: vi.fn().mockResolvedValue(true),
}));
// Mock function
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.