dart-migrate-to-checks-package

Migrate Dart test suites from matcher assertions to the package:checks API.

428|29|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/dart-lang/skills --skill dart-migrate-to-checks-package
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dart-migrate-to-checks-package
Source: https://github.com/dart-lang/skills/tree/main/skills/dart-migrate-to-checks-package
Command: npx skills add https://github.com/dart-lang/skills --skill dart-migrate-to-checks-package

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Replaces legacy Dart test assertions that rely on package:matcher with the modern, type-safe package:checks API, reducing brittleness and improving failure diagnostics.

Core Features & Use Cases

  • Import modernization: updates test imports from package:test to utilize package:checks scaffolding.
  • Assertion translation: converts expect/expectLater and common matchers to Checks equivalents, including deep equality and has-style checks.
  • Incremental migration: supports partial migration strategies and safe, repeatable refactors across multiple files.
  • Use Case: migrate a large test suite from matcher-based assertions to a Checks-based pattern to gain stronger type-safety and clearer failures.

Quick Start

Run the migration workflow to replace legacy matcher assertions with Checks equivalents across all tests.

Frequently Asked Questions about dart-migrate-to-checks-package

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate Dart tests from package:matcher to package:checks?

You can migrate Dart tests from package:matcher to package:checks using a migration workflow that translates expect/expectLater assertions, updates imports, handles deep equality, and verifies asynchronous patterns for type safety.

What is the difference between package:checks and package:matcher in Dart?

package:checks replaces legacy package:matcher assertions in Dart with a modern, type-safe API, reducing test brittleness and providing clearer, more precise failure diagnostics during test runs.

Can I incrementally refactor a Dart test suite to use package:checks?

Yes, you can incrementally refactor Dart test suites to package:checks by applying partial migration strategies, enabling safe and repeatable refactors across multiple test files without a full immediate overhaul.

How are deep equality and asynchronous patterns handled when migrating to package:checks?

Migrating to package:checks handles deep equality by translating matcher logic to has-style checks, and addresses asynchronous patterns by converting expectLater usages to their Checks equivalents with built-in verification steps.

Does the Dart Checks migration workflow support package:test with expectLater?

Yes, the Dart Checks migration workflow supports projects using package:test, directly translating both expect and expectLater assertion functions into their modern, type-safe package:checks equivalents.