Understand the difit testing strategy and tools
mainThe difit project uses Vitest for its testing framework. The testing strategy is divided into two main categories:
- Unit Tests: Run in isolation with all dependencies mocked. They focus on logic and edge cases with fast execution and no side effects.
- Integration Tests: Mock only external dependencies (like Git or the file system) to test component interactions and actual HTTP communication.
Safety Measures during testing:
- No actual Git operations are performed (they are fully mocked).
- Random ports are used for server tests to avoid conflicts.
- All resources are cleaned up in
afterEach. - No modifications are made to the working directory.