Testing Mastery
Platform-agnostic testing strategy covering Web, Backend, Desktop, and Mobile applications. Core principles apply across all platforms.
Note: Desktop (Tauri/Electron) and Mobile (React Native/Flutter) testing guides coming soon.
Platform Coverage
| Platform |
Status |
Frameworks |
| Web Frontend |
✅ Complete |
Vitest, Playwright, React Testing Library |
| Web Backend |
✅ Complete |
Rust (cargo test), Go, Python (pytest), Node |
| Desktop |
🚧 Coming |
Tauri, Electron (WebDriver) |
| Mobile |
🚧 Coming |
React Native (Detox), Flutter |
Testing Pyramid (70-20-10)
| Layer |
Ratio |
Framework |
Speed |
What to Test |
| Unit |
70% |
Vitest |
<50ms |
Functions, utils, state logic |
| Integration |
20% |
Vitest + MSW |
100-500ms |
API endpoints, DB ops, modules |
| E2E |
10% |
Playwright |
5-30s |
Critical flows (login, checkout) |
Quick Start
# Unit tests
npx vitest run # Run all
npx vitest run --coverage # With coverage
npx vitest --ui # Visual UI
# E2E tests
npx playwright test # Run all
npx playwright test --ui # Interactive UI
npx playwright test --headed # See browser
npx playwright codegen https://myapp.com # Record test
# Load test
k6 run load-test.js
# Accessibility
npx @axe-core/cli https://myapp.com
npx lighthouse https://myapp.com --output=html
Reference Navigation
Frontend Testing
- Unit & Integration Testing — Vitest patterns, mocking, MSW, test organization
- E2E Testing with Playwright — Page objects, selectors, assertions, parallelism, debugging
- Component Testing — React Testing Library, render patterns, user events
Backend Testing (Multi-stack)
- Backend Unit Testing — Rust (cargo test), Go, Python (pytest), Node (Jest/Vitest)
- API Integration Testing — HTTP endpoint testing, database integration, test containers
- Database Testing — Migration tests, fixtures, transaction rollback patterns
Performance & Load
- Load Testing with k6 — Scenarios, thresholds, custom metrics, CI integration
- Performance Testing — Core Web Vitals, Lighthouse CI, bundle analysis
- API Load Testing — Backend stress testing, concurrency, benchmarking
Security & Accessibility
- Security Testing — OWASP Top 10, SQL injection, XSS, CSRF, auth bypasses
- Accessibility Testing — WCAG 2.1, axe-core, keyboard nav, screen readers
Quality & Strategy
- Visual Regression — Screenshot comparison, responsive snapshots, CI workflow
- Test Strategy Guide — What to test, flakiness mitigation, test data, CI/CD gates
- Cross-Browser & Mobile — Browser matrix, device testing, responsive verification
CI/CD Integration
Frontend Pipeline
jobs:
test-frontend:
steps:
- run: npm run test:unit # Gate 1: Fast fail (<30s)
- run: npm run test:integration # Gate 2: API mocking
- run: npm run test:e2e # Gate 3: Critical flows
- run: npm run test:a11y # Gate 4: Accessibility
- run: npx lhci autorun # Gate 5: Performance
Backend Pipeline (Rust)
jobs:
test-backend:
steps:
- run: cargo test --lib # Unit tests
- run: cargo test --test '*' # Integration tests
- run: cargo clippy # Linting
Backend Pipeline (Multi-stack)
# Go
- run: go test ./...
- run: golangci-lint run
# Python
- run: pytest tests/
- run: ruff check .
# Node.js
- run: npm run test
- run: npm run lint
Best Practices
- Test behavior, not implementation — Test what the user sees, not internal state
- Arrange-Act-Assert — Clear structure for every test
- Avoid test interdependence — Each test runs in isolation
- Use factories, not fixtures — Generate fresh test data
- Flaky tests = bugs — Fix or quarantine immediately
- Coverage ≠ Quality — 80% meaningful > 100% shallow
Related Skills
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: testing-413description: Comprehensive testing across platforms — Web (Playwright, Vitest), Backend (Rust/Go/Python/Node API testing), Desktop (Tauri, Electron), Mobile (React Native, Flutter - coming soon). Unit, integration, E2E, load, security, accessibility testing. Use for test automation, quality assurance, CI/CD integration. Use when this capability is needed.4---56# Testing Mastery78Platform-agnostic testing strategy covering Web, Backend, Desktop, and Mobile applications. Core principles apply across all platforms.910> **Note:** Desktop (Tauri/Electron) and Mobile (React Native/Flutter) testing guides coming soon.1112## Platform Coverage1314| Platform | Status | Frameworks |15|----------|--------|------------|16| **Web Frontend** | ✅ Complete | Vitest, Playwright, React Testing Library |17| **Web Backend** | ✅ Complete | Rust (cargo test), Go, Python (pytest), Node |18| **Desktop** | 🚧 Coming | Tauri, Electron (WebDriver) |19| **Mobile** | 🚧 Coming | React Native (Detox), Flutter |2021## Testing Pyramid (70-20-10)2223| Layer | Ratio | Framework | Speed | What to Test |24|-------|-------|-----------|-------|-------------|25| Unit | 70% | Vitest | <50ms | Functions, utils, state logic |26| Integration | 20% | Vitest + MSW | 100-500ms | API endpoints, DB ops, modules |27| E2E | 10% | Playwright | 5-30s | Critical flows (login, checkout) |2829## Quick Start3031```bash32# Unit tests33npx vitest run # Run all34npx vitest run --coverage # With coverage35npx vitest --ui # Visual UI3637# E2E tests38npx playwright test # Run all39npx playwright test --ui # Interactive UI40npx playwright test --headed # See browser41npx playwright codegen https://myapp.com # Record test4243# Load test44k6 run load-test.js4546# Accessibility47npx @axe-core/cli https://myapp.com48npx lighthouse https://myapp.com --output=html49```5051## Reference Navigation5253### Frontend Testing54- **[Unit & Integration Testing](references/unit-integration-testing.md)** — Vitest patterns, mocking, MSW, test organization55- **[E2E Testing with Playwright](references/e2e-playwright.md)** — Page objects, selectors, assertions, parallelism, debugging56- **[Component Testing](references/component-testing.md)** — React Testing Library, render patterns, user events5758### Backend Testing (Multi-stack)59- **[Backend Unit Testing](references/backend-unit-testing.md)** — Rust (cargo test), Go, Python (pytest), Node (Jest/Vitest)60- **[API Integration Testing](references/api-integration-testing.md)** — HTTP endpoint testing, database integration, test containers61- **[Database Testing](references/database-testing.md)** — Migration tests, fixtures, transaction rollback patterns6263### Performance & Load64- **[Load Testing with k6](references/load-testing-k6.md)** — Scenarios, thresholds, custom metrics, CI integration65- **[Performance Testing](references/performance-testing.md)** — Core Web Vitals, Lighthouse CI, bundle analysis66- **[API Load Testing](references/api-load-testing.md)** — Backend stress testing, concurrency, benchmarking6768### Security & Accessibility69- **[Security Testing](references/security-testing.md)** — OWASP Top 10, SQL injection, XSS, CSRF, auth bypasses70- **[Accessibility Testing](references/accessibility-testing.md)** — WCAG 2.1, axe-core, keyboard nav, screen readers7172### Quality & Strategy73- **[Visual Regression](references/visual-regression.md)** — Screenshot comparison, responsive snapshots, CI workflow74- **[Test Strategy Guide](references/test-strategy-guide.md)** — What to test, flakiness mitigation, test data, CI/CD gates75- **[Cross-Browser & Mobile](references/cross-browser-mobile.md)** — Browser matrix, device testing, responsive verification7677## CI/CD Integration7879### Frontend Pipeline80```yaml81jobs:82 test-frontend:83 steps:84 - run: npm run test:unit # Gate 1: Fast fail (<30s)85 - run: npm run test:integration # Gate 2: API mocking86 - run: npm run test:e2e # Gate 3: Critical flows87 - run: npm run test:a11y # Gate 4: Accessibility88 - run: npx lhci autorun # Gate 5: Performance89```9091### Backend Pipeline (Rust)92```yaml93jobs:94 test-backend:95 steps:96 - run: cargo test --lib # Unit tests97 - run: cargo test --test '*' # Integration tests98 - run: cargo clippy # Linting99```100101### Backend Pipeline (Multi-stack)102```yaml103# Go104- run: go test ./...105- run: golangci-lint run106107# Python108- run: pytest tests/109- run: ruff check .110111# Node.js112- run: npm run test113- run: npm run lint114```115116## Best Practices1171181. **Test behavior, not implementation** — Test what the user sees, not internal state1192. **Arrange-Act-Assert** — Clear structure for every test1203. **Avoid test interdependence** — Each test runs in isolation1214. **Use factories, not fixtures** — Generate fresh test data1225. **Flaky tests = bugs** — Fix or quarantine immediately1236. **Coverage ≠ Quality** — 80% meaningful > 100% shallow124125## Related Skills126127| Skill | When to Use |128|-------|-------------|129| [rust-backend-advance](../rust-backend-advance/SKILL.md) | Rust-specific testing patterns with cargo test |130| [nextjs-turborepo](../nextjs-turborepo/SKILL.md) | Next.js E2E testing setup |131| [databases](../databases/SKILL.md) | Database testing, migrations |132| [devops](../devops/SKILL.md) | CI/CD pipeline test integration |133| [debugging](../debugging/SKILL.md) | Test failure investigation |134| [security](../security/SKILL.md) | Security testing methodologies |135136---137> Converted and distributed by [TomeVault](https://tomevault.io/claim/thienty1207) — claim your Tome and manage your conversions.138<!-- tomevault:4.0:skill_md:2026-04-16 -->