testing
/testing
Testing knowledge base - Vitest, Playwright, Testing Library, accessibility testing. Use when setting up a test suite, writing unit/E2E tests, implementing visual regression tests, or testing accessibility.
- Author
- PIXARTSeu ↗
- Repository
- Synapse ↗
- Licence
- AGPL-3.0
- Last repository change
- 15.09.2026
Assessment and security
- Files in this package
- 4
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 2
No signals detected. Repository changed on 15.09.2026, without references to retired models or APIs.
AGPL-3.0, copyleft: przeróbki udostępniane innym muszą mieć tę samą licencję.
What it does and when to use it
Testing knowledge base - Vitest, Playwright, Testing Library, accessibility testing. Use when setting up a test suite, writing unit/E2E tests, implementing visual regression tests, or testing accessibility.
Original author description
Testing knowledge base - Vitest, Playwright, Testing Library, accessibility testing. Use when setting up a test suite, writing unit/E2E tests, implementing visual regression tests, or testing accessibility.
How it works
- Vitest Setup
- Unit Tests
- Component Tests
- Playwright E2E
- Visual Testing
- Accessibility Testing
- Scripts
SKILL.md preview
---
name: testing
description: Testing knowledge base - Vitest, Playwright, Testing Library, accessibility testing. Use when setting up a test suite, writing unit/E2E tests, implementing visual regression tests, or testing accessibility.
version: 1.0.0
---
# Testing Knowledge Base
## Vitest Setup
```bash
npm install -D vitest @testing-library/react @testing-library/jest-dom jsdom
```
```typescript
// vitest.config.ts
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
test: {
globals: true,
environment: 'jsdom',
setupFiles: './src/test/setup.ts',
coverage: {
provider: 'v8',
thresholds: { global: { lines: 80 } },
},
},
});
```
```typescript
// src/test/setup.ts
import '@testing-library/jest-dom/vitest';
import { cleanup } from '@testing-library/react';
import { afterEach } from 'vitest';
afterEach(() => cleanup());
```
## Unit Tests
```typescript
// utils.test.ts
import { describe, it, expect } from 'vitest';
import { formatPrice } from './utils';
describe('formatPrice', () => {
it('formats EUR correctly', () => {
expect(formatPrice(1234.56)).toBe('1.234,56 €');
});
it('handles zero', () => {
expect(formatPrice(0)).toBe('0,00 €');
});
});
```
## Component Tests
```tsx
// Button.test.tsx
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { Button } from './Button';
describe('Button', () => {
it('renders correctly', () => {
render(<Button>Click me</Button>);
expect(screen.getByRole('button')).toHaveTextContent('Click me');
});
it('calls onClick when clicked', async () => {
const onClick = vi.fn();
render(<Button onClick={onClick}>Click</Button>);
await userEvent.click(screen.getByRole('button'));
expect(onClick).toHaveBeenCalledOnce();
});
it('is disabled when loading', () => {
render(<Button isLoading>Submit</Button>);
expect(screen.getByRole('button')).toBeDisabled();
});
});
```
## Playwright E2E
```bash
npm install -D @playwright/test
npx playwright install
```
```typescript
// playwright.config.ts
import { defineConfig } from '@playwright/test';
export default defineConfig({
testDir: './e2e',
use: {
baseURL: 'http://localhost:3000',
trace: 'on-first-retry',
},
webServer: {
command: 'npm run dev',
url: 'http://localhost:3000',
},
});
```
```typescript
// e2e/contact.spec.ts
import { test, expect } from '@playwright/test';
test('contact form submission', async ({ page }) => {
await page.goto('/contact');
await page.getByLabel(/nome/i).fill('Mario Rossi');
await page.getByLabel(/email/i).fill('mario@test.com');
await page.getByLabel(/messaggio/i).fill('Test message');
await page.getByRole('button', { name: /invia/i }).click();
await expect(page.getByText(/inviato/i)).toBeVisible();
});
```
## Visual Testing
```typescript
// e2e/visual.spec.ts
import { test, expect } from '@playwright/test';
test('homepage visual', async ({ page }) => {
await page.goto('/');
await expect(page).toHaveScreenshot('homepage.png', {
maxDiffPixels: 100,
});
});
```
## Accessibility Testing
```typescript
// e2e/a11y.spec.ts
import { test, expect } from '@playwright/test';
import AxeBuilder from '@axe-core/playwright';
test('homepage accessibility', async ({ page }) => {
await page.goto('/');
const results = await new AxeBuilder({ page })
.withTags(['wcag2aa'])
.analyze();
expect(results.violations).toEqual([]);
});
```
## Scripts
```json
{
"scripts": {
"test": "vitest",
"test:coverage": "vitest run --coverage",
"test:e2e": "playwright test",
"test:a11y": "playwright test --grep @a11y"
}
}
```
Files in this package (4)
- SKILL.md 4 KB
- learnings.md 1 KB
- evals/evals.json 2 KB
- evals/trigger_evals.json 1 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · PIXARTSeu/Synapse | 95 | AGPL-3.0 |
| iuliandita/skills | 100 | MIT |
| wrongstack/wrongstack | 100 | MIT |
| langwatch/langwatch | 100 | Apache-2.0 |
| mcouthon/agents | 100 | MIT |
| nteract/nteract | 100 | BSD-3-Clause |
| kettleofketchup/DraftForge | 100 | GPL-3.0 |
| skillberry-ai/cap-evolve | 100 | Apache-2.0 |
| TheBeardedBearSAS/claude-craft | 100 | MIT |
Database snapshot: 13.11.2026 · package version aecc577c3dc7 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100testing-e2e
End-to-end testing patterns with Playwright — page objects, AI agent testing, visual regression, accessibility testing with axe-core, and CI integration. Use when writing E2E tests, setting up Playwright, implementing visual regression, or testing accessibility. - 100react-testing
React component testing with Testing Library and Vitest. Covers unit tests, integration tests, async testing, mocking, user events, accessibility testing, and test patterns. USE WHEN: user mentions "React testing", "Testing Library", "Vitest", "component tests", "userEvent",… - 100playwright-testing
Playwright E2E testing — cross-browser, visual regression, API testing, mobile emulation. Use when writing E2E tests or setting up automated UI testing for web apps. - 100vitest
Vitest testing framework. Covers unit tests, mocking, and coverage. Use for testing Vite-based and Node.js projects. USE WHEN: user mentions "vitest", "vite test", "unit test", asks about "vi.fn", "vi.mock", "test coverage", "mock functions", "test vite project" DO NOT USE FOR:… - 100nextjs-testing
Write Jest or Vitest unit tests with React Testing Library and Playwright E2E tests for Next.js projects. Use when testing components with RTL, mocking APIs with MSW, or creating Playwright user flow tests. - 100frontend-testing
Write tests that start with acceptance criteria, then add implementation tests for robustness. Use when writing unit tests (Vitest), end-to-end tests (Playwright), visual regression tests, or accessibility tests. Emphasizes user-centric testing, semantic locators, accessibility…