← ClaudeAtlas

dart-migrate-to-checks-packagelisted

Replace the usage of `expect` and similar functions from `package:matcher` to `package:checks` equivalents.
novahiz/novahiz · ★ 1 · AI & Automation · score 70
Install: claude install-skill novahiz/novahiz
# Migrating Dart Tests to Package Checks Use this skill when you need to migrate a Dart test suite from the legacy `package:matcher` (which is exported by default from `package:test/test.dart`) to the modern, type-safe, and literate `package:checks` assertion library. ## Contents - [When to Use This Skill](#when-to-use-this-skill) - [How to Use This Skill (The Workflow)](#how-to-use-this-skill-the-workflow) - [Key Syntax Differences and Pitfalls](#key-syntax-differences-and-pitfalls) - [Matcher-to-Checks Mapping Table](#matcher-to-checks-mapping-table) - [Matchers with No Direct Replacements](#matchers-with-no-direct-replacements) - [Strategies for Discovery](#strategies-for-discovery) - [Examples](#examples) --- ## When to Use This Skill - When asked to "migrate tests to checks", "use package:checks", or "modernize test assertions". - When updating legacy test suites where static type safety, better autocomplete in IDEs, and highly detailed failure diagnostics are desired. --- ## How to Use This Skill (The Workflow) Follow this structured workflow to safely and systematically migrate a test suite: ### 1. Dependency Setup - Add `package:checks` as a `dev_dependency` in `pubspec.yaml`: ```bash dart pub add dev:checks ``` - Remove `package:matcher` if it is explicitly listed under `dev_dependencies` (it is typically transitively included by `package:test`, which is fine). ### 2. Identify and Plan Target Files - Use the grep patterns in [Strategies for Disco