dart-migrate-to-checks-package
Migrating Dart Tests to Package Checks
Contents
- Dependency Management
- Syntax Migration Guidelines
- Utilizing Dart MCP Tools
- Migration Workflow
- Examples
Dependency Management
Manage dependencies using the Dart Tooling MCP Server pub tool or standard CLI commands.
- Add
package:checksas adev_dependencyusingdart pub add dev:checks. - Remove
package:matcherif it is explicitly listed in thepubspec.yaml(note: it is often transitively included bypackage:test, which is fine). - Import
package:checks/checks.dartin all test files undergoing migration.
Syntax Migration Guidelines
Transition test assertions from the package:matcher syntax to the literate API provided by package:checks.
- Basic Equality: Replace
expect(actual, equals(expected))orexpect(actual, expected)withcheck(actual).equals(expected).
More from dart-lang/skills
dart-add-unit-test
Write and organize unit tests for functions, methods, and classes using `package:test`. Use when creating new logic or fixing bugs to ensure code remains correct and regression-free.
2.1Kdart-fix-runtime-errors
Uses get_runtime_errors and lsp to fetch an active stack trace, locate the failing line, apply a fix, and verify resolution via hot_reload.
2.1Kdart-run-static-analysis
Execute `dart analyze` to identify warnings and errors, and use `dart fix --apply` to automatically resolve mechanical lint issues. Use during development to ensure code quality and before committing changes.
2.0Kdart-use-pattern-matching
Use switch expressions and pattern matching where appropriate
2.0Kdart-resolve-package-conflicts
Workflow for fixing package version conflicts. Use this when `pub get` fails due to incompatible package versions.
2.0Kdart-collect-coverage
Collect coverage using the coverage packge and create an LCOV report
2.0K