| name | migrate-to-shoehorn |
| description | Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data. |
| tags | ["mattpocock","migrate-to-shoehorn","typescript"] |
--------- | -------------------------------------------------- |
| fromPartial() | Pass partial data that still type-checks |
| fromAny() | Pass intentionally wrong data (keeps autocomplete) |
| fromExact() | Force full object (swap with fromPartial later) |
Workflow
-
Gather requirements - ask user:
- What test files have
as assertions causing problems?
- Are they dealing with large objects where only some properties matter?
- Do they need to pass intentionally wrong data for error testing?
-
Install and migrate: