dart-add-unit-test

Installation
SKILL.md

Testing Dart and Flutter Applications

Contents

Structuring Test Files

Organize test files to mirror the lib directory structure to maintain predictability.

  • Place all test code within the test directory at the root of the package.
  • Append _test.dart to the end of all test file names (e.g., lib/src/utils.dart should be tested in test/src/utils_test.dart).
  • If writing integration tests, place them in an integration_test directory at the root of the package.

Writing Tests

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

  • Import package:test/test.dart (or package:flutter_test/flutter_test.dart for Flutter).
Related skills
Installs
2.1K
GitHub Stars
214
First Seen
Apr 24, 2026