dart-testing

Installation
SKILL.md

Dart Testing Suite

Contents

Unit Testing

Utilize package:test as the standard testing library for Dart CLI and backend applications.

  • Organize test files to mirror the lib directory structure. Append _test.dart to test files.
  • Group related tests using the group() function.
  • Use setUp() and tearDown() for shared test state.
  • Write pure logic inside Domain/BLoC and extract to static pure functions for 100% unit test coverage.
  • Use string interpolation for test group names: group('$ClassName', ...)
  • Structure each test using the Arrange-Act-Assert (Given-When-Then) convention:
    • Arrange: Set up mocks, create instances, prepare input data.
    • Act: Call the method under test.
    • Assert: Verify the output or side effects.
  • Separate setup from verification to keep tests readable and maintainable.
Installs
11
GitHub Stars
20
First Seen
May 10, 2026
dart-testing — dhruvanbhalara/skills