Testing with Vitest
This focused one-day course teaches you everything about testing JavaScript and TypeScript applications with Vitest. You'll learn test-driven development workflows, writing effective unit and integration tests, mocking strategies, snapshot testing, code coverage analysis, and CI/CD pipeline integration. Practical examples from real projects included.
Skills You'll Learn
Course Modules & Lessons
Vitest Fundamentals
Setup, configuration, writing your first tests, and test runner features
Vitest installieren & konfigurieren
Setup, vitest.config.ts und Integration in bestehende Projekte
Ersten Test schreiben
describe, it, expect und die wichtigsten Matcher
Test Runner Features
Watch Mode, Filtering, nur fehlgeschlagene Tests und Reporter
Teststruktur & Organisation
Dateibenennung, Ordnerstruktur und Setup/Teardown
Advanced Testing
Mocking, spying, stubbing, async testing, and snapshot tests
Mocking & Spying
vi.fn(), vi.mock() und vi.spyOn() effektiv einsetzen
Module Mocking
Ganze Module und Abhängigkeiten mocken
Async Testing
Promises, Timer und asynchrone Funktionen testen
Snapshot Tests
Snapshots erstellen, aktualisieren und sinnvoll einsetzen
Real-World Patterns
Testing Vue/React components, API mocking, and coverage strategies
Vue-Komponenten testen
mount, shallowMount und Interaktionen mit Vue Test Utils
React-Komponenten testen
render, screen und userEvent mit Testing Library
API-Mocking mit MSW
Mock Service Worker für realistische API-Tests
Code Coverage analysieren
Coverage-Berichte lesen und Schwachstellen finden
CI & Automation
GitHub Actions integration, coverage thresholds, and test reporting
GitHub Actions für Tests
Workflow-Datei erstellen und Tests automatisch ausführen
Coverage Thresholds
Mindest-Coverage definieren und im CI erzwingen
Test-Reporting & Badges
JUnit-Reports, Coverage-Badges und PR-Kommentare
Best Practices & Wartung
Flaky Tests vermeiden, Testpyramide und Refactoring-Strategien
Prerequisites
Your Trainer

David Pinezich
Experienced IT architect and trainer specializing in Python, Cloud Architecture, and Enterprise Solutions. Certified TOGAF, CISSP, and AWS professional with years of hands-on training experience.