Instructions Update

This commit is contained in:
Nino
2025-04-22 12:23:39 +02:00
parent 39d101d456
commit fa5ad7a561
4 changed files with 96 additions and 36 deletions

View File

@@ -1,10 +1,12 @@
# Testing Instructions
## Framework and Tools
- Use **Jest** as the testing framework.
- For unit tests, utilize **Spectator** to simplify Angular component testing.
## Guidelines
1. **Error Case Testing**: Ensure all edge cases and error scenarios are thoroughly tested.
2. **Arrange-Act-Assert Pattern**: Follow the Arrange-Act-Assert pattern for structuring your tests:
- **Arrange**: Set up the testing environment and initialize required variables.
@@ -12,12 +14,14 @@
- **Assert**: Verify the expected outcomes.
## Best Practices
- Write clear and descriptive test names.
- Ensure tests are isolated and do not depend on each other.
- Mock external dependencies to avoid side effects.
- Aim for high code coverage without compromising test quality.
## Example Test Structure
```typescript
// Example using Jest and Spectator
import { createComponentFactory, Spectator } from '@ngneat/spectator';
@@ -57,5 +61,6 @@ describe('MyComponent', () => {
```
## Additional Resources
- [Jest Documentation](https://jestjs.io/docs/getting-started)
- [Spectator Documentation](https://ngneat.github.io/spectator/)
- [Spectator Documentation](https://ngneat.github.io/spectator/)