Getting Started (Beginner Guide)
A beginner-friendly guide to testing Aurelia applications and components
Why Test?
Quick Start
1. Install Testing Dependencies
npm install --save-dev @aurelia/testing jest @types/jest2. Configure Your Test Environment
3. Configure Jest
Your First Test
The Component
The Test
Run Your Tests
Understanding the Test Structure
1. createFixture
2. Assertions
3. Cleanup
Testing Common Scenarios
Testing User Input
Testing Forms
Testing Lists and Loops
Testing Conditional Rendering
Testing with Dependencies
Component with Service
Testing with Mocks
Testing Best Practices
1. Write Descriptive Test Names
2. Test Behavior, Not Implementation
3. Keep Tests Independent
4. Use AAA Pattern
5. Test Edge Cases
Common Testing Patterns
Setup and Teardown
Testing Async Operations
Snapshot Testing
Troubleshooting
"Platform not set" Error
Component Not Updating
Element Not Found
Next Steps
Summary
Last updated
Was this helpful?