用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/vuralserhat86/antigravity-agentic-skills --skill vitest-runner命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Guide for conducting comprehensive accessibility audits of code to identify WCAG compliance issues and barriers to inclusive design. This skill should be used when reviewing accessibility, ARIA implementation, keyboard navigation, or screen reader compatibility.
Transform clarified user requests into structured delegation prompts optimized for specialist agents (cto-architect, strategic-cto-mentor, cv-ml-architect). Use after clarification is complete, before routing to specialist agents. Ensures agents receive complete context for effective work.
AGENTS.md dosyaları oluşturma, monorepo yapılandırma ve agent instruction yönetimi rehberi.
基于 SOC 职业分类
正在显示 SKILL.md
| name | vitest_runner |
| router_kit | FullStackKit |
| description | Modern JavaScript/TypeScript testing with Vitest including mocking and coverage. |
| metadata | {"skillport":{"category":"auto-healed","tags":["architecture","assertions","automation","best practices","clean code","coding","collaboration","compliance","debugging","design patterns","development","documentation","efficiency","git","jest compatible","mocking","optimization","productivity","programming","project management","quality assurance","refactoring","software engineering","standards","testing","unit testing","utilities","version control","vite","vitest runner","workflow"]}} |
Modern JavaScript/TypeScript testing with Vitest including mocking and coverage.
import { describe, it, expect } from 'vitest';
describe('math', () => {
it('should add numbers', () => {
expect(1 + 1).toBe(2);
});
it('should throw on invalid input', () => {
expect(() => divide(1, 0)).toThrow('Division by zero');
});
});
import { vi, describe, it, expect } from 'vitest';
// Mock module
vi.mock('./api', () => ({
fetchUser: vi.fn().mockResolvedValue({ id: 1 })
}));
// Mock function
const callback = vi.fn();
callback('arg');
expect(callback).toHaveBeenCalledWith('arg');
it('should fetch data', async () => {
const data = await fetchData();
expect(data).toEqual({ id: 1 });
});
it('should reject on error', async () => {
await expect(fetchData()).rejects.toThrow('Error');
});
import { render, screen } from '@testing-library/react';
import { userEvent } from '@testing-library/user-event';
it('should handle click', async () => {
const onClick = vi.fn();
render(<Button onClick={onClick}>Click</Button>);
await userEvent.click(screen.getByRole('button'));
expect(onClick).toHaveBeenCalled();
});
Kaynak: Vitest Official Documentation & Vite + Testing Best Practices
vitest.config.ts dosyasının Vite ayarlarıyla senkronize olduğunu doğrula.jsdom veya happy-dom, backend için node environment'ı seç.setup.ts içinde global mock'ları tanımla.vi.mock() ile izole ederek sadece hedef üniteyi test et.expect metodlarını kullanarak beklenen sonuçları (be.truthy, toEqual, toBeCalled) doğrula.toMatchSnapshot() ile yakala.watch modunda tutarak anlık geri bildirim al.v8 veya istanbul provider kullanarak test kapsamını raporla.vi.clearAllMocks() ile testler arası veri kirliliğini (Pollution) önle.| Aşama | Doğrulama |
|---|---|
| 1 | Test dosyaları *.test.ts veya *.spec.ts formatında mı? |
| 2 | Asenkron kodlar (async/await) doğru handle ediliyor mu? |
| 3 | Karmaşık nesne karşılaştırmalarında toBe (referans) yerine toEqual (değer) mi kullanıldı? |
Vitest Runner v1.5 - With Workflow