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
testdirectory at the root of the package. - Append
_test.dartto the end of all test file names (e.g.,lib/src/utils.dartshould be tested intest/src/utils_test.dart). - If writing integration tests, place them in an
integration_testdirectory at the root of the package.
Writing Tests
Utilize package:test as the standard testing library for Dart applications.