migrate-to-shoehorn

Migrate TypeScript test code from as assertions to shoehorn fromPartial and fromAny patterns.

Updated May 15, 2026
One-click install
npx skills add https://github.com/az9713/engineer-skills-tutorial --skill migrate-to-shoehorn-az9713
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-to-shoehorn
Source: https://github.com/az9713/engineer-skills-tutorial/tree/main/skills/misc/migrate-to-shoehorn
Command: npx skills add https://github.com/az9713/engineer-skills-tutorial --skill migrate-to-shoehorn-az9713

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrate test files away from brittle as assertions to safer, partial data handling with shoehorn in tests.

Core Features & Use Cases

  • Convert as Type assertions to partial data with fromPartial.
  • Convert as unknown as Type to fromAny for intentionally wrong data.
  • Guide migration workflow for large test suites and complex objects.

Quick Start

Run the migration on your test files to convert as assertions to fromPartial or fromAny using shoehorn.

Frequently Asked Questions about migrate-to-shoehorn

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

FAQPage Schema
How do I migrate TypeScript test code from as assertions to safer type checks?

Migrating TypeScript test code from as assertions involves converting them to partial data handling with shoehorn's fromPartial and fromAny helpers for safer type-safe conversions.

What's the best way to handle large nested data structures in TypeScript unit tests?

Handling large nested data structures in TypeScript unit tests is best done by migrating to shoehorn-powered patterns using fromPartial to safely manage partial data without brittle type assertions.

Do I need the @total-typescript/shoehorn library to use fromPartial in my tests?

Yes, you need the @total-typescript/shoehorn library to use fromPartial and fromAny helpers, which provide the proper imports required for type-safe test data conversions.

When should I use fromAny instead of fromPartial during a test migration?

Use fromAny instead of fromPartial during test migration when converting as unknown as Type patterns for intentionally wrong data, while fromPartial handles standard partial data structures.

Can I automate converting as unknown as Type patterns across a large test suite?

Automating test suite migration converts legacy as unknown as Type patterns to shoehorn's fromAny helper, guiding the workflow for complex objects and large test files.

Why are as assertions considered brittle in TypeScript unit tests with partial data?

As assertions are considered brittle in TypeScript unit tests because they bypass type checking, making partial data handling unsafe compared to using shoehorn's type-safe fromPartial conversions.