Skip to main content

Overview

Zeus uses a comprehensive testing strategy including unit tests, widget tests, and integration tests.

Unit Tests

Test business logic in isolation:

Widget Tests

Test UI components:

BLoC Tests

Use bloc_test package:

Integration Tests

Test complete user flows:

Running Tests

Best Practices

  1. Test behavior, not implementation - Don’t test private methods
  2. Use mocks - Don’t hit real APIs in unit tests
  3. Test edge cases - Empty lists, null values, errors
  4. Keep tests fast - Unit tests should run in milliseconds
  5. Name tests clearly - test('should return error when network fails')