migrate-to-shoehorn

Migrate TypeScript test code from as assertions to Shoehorn fromPartial and fromAny utilities.

1|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/paialex/ai-skills-bank --skill migrate-to-shoehorn-paialex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-to-shoehorn
Source: https://github.com/paialex/ai-skills-bank/tree/main/mattpocock_skills/misc/migrate-to-shoehorn
Command: npx skills add https://github.com/paialex/ai-skills-bank --skill migrate-to-shoehorn-paialex

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrate test files away from as type assertions to the Shoehorn library, enabling safer, partial data in tests.

Core Features & Use Cases

  • Replaces as Type assertions with fromPartial() to create partial, type-safe test data
  • Replaces as unknown as Type with fromAny() to simulate incorrect data while preserving typing
  • Provides migration guidance and workflow for updating tests in large codebases

Quick Start

Scan your tests for as assertions and migrate them by wrapping with fromPartial or fromAny as appropriate.

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 partial data?

To migrate TypeScript test code from as assertions, replace them with Shoehorn utilities like fromPartial() for type-safe partial objects and fromAny() for intentionally incorrect data. This updates test imports and improves type safety in unit tests.

What is the best way to create partial mock objects in TypeScript unit tests?

Creating partial mock objects in TypeScript unit tests is best done by replacing as Type assertions with the fromPartial() utility from the Shoehorn library. This provides type-safe partial data and large mocks without breaking strict typing rules.

How do I simulate incorrect data in TypeScript tests without losing type safety?

To simulate incorrect data in TypeScript tests while preserving typing, replace as unknown as Type assertions with the fromAny() utility from the Shoehorn library. This allows you to intentionally pass wrong data types safely.

Can I use Shoehorn migration utilities with common TypeScript test frameworks?

Yes, Shoehorn migration utilities apply to unit tests across TypeScript projects using common test frameworks. By updating test imports to include fromPartial and fromAny, you can safely migrate large codebases to safer partial data.

Why should I replace as type assertions with Shoehorn in my test files?

You should replace as type assertions with Shoehorn in test files because it improves type safety by using fromPartial for required partial data and fromAny for incorrect data, eliminating the risks of unchecked type casting in TypeScript projects.

What are the limitations of migrating large codebases to Shoehorn utilities?

When migrating large codebases to Shoehorn utilities, the primary constraint is the need to scan all tests for as assertions and manually update test imports. The workflow requires applying fromPartial and fromAny appropriately across common test frameworks.