dart-migrate-to-checks-package
Installation
SKILL.md
Contents
- Why Migrate to package:checks
- Dependency Management
- Assertion Mapping and Syntax Guidelines
- Advanced Asynchronous Assertions
- Workflow: Executing Syntax Migrations
- Examples
Why Migrate to package:checks
package:checks is a modern assertion library maintained by the Dart team that replaces package:matcher. It offers several benefits over traditional matchers:
- Fluent API: Chain assertions naturally using Dart methods instead of nested helper functions.
- Type Safety: Benefit from compiler checks on expected properties, preventing type mismatches in tests.
- Descriptive Diagnostics: Read extremely clear failure messages showing exactly what failed and why (e.g. displaying collection differences).
Dependency Management
To add the checks library to your package: