migrate-to-shoehorn

Migrate TypeScript tests from as assertions to shoehorn helpers.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/RemseyMailjard/superpowers --skill migrate-to-shoehorn
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: migrate-to-shoehorn
Source: https://github.com/RemseyMailjard/superpowers/tree/main/.github/skills/migrate-to-shoehorn
Command: npx skills add https://github.com/RemseyMailjard/superpowers --skill migrate-to-shoehorn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams migrate test files that rely on as assertions to shoehorn-based patterns, enabling safer, partial data in tests.

Core Features & Use Cases

  • Replace as assertions with shoehorn helpers such as fromPartial and fromAny to keep tests readable and type-safe.
  • Update imports and test structures to leverage shoehorn to validate partial payloads without asserting full objects.
  • Use cases include migrating large input objects where only a subset of properties matters, and refining tests for error scenarios.

Quick Start

Migrate test files that use as type assertions to shoehorn-based patterns to enable safer partial data in tests.

Frequently Asked Questions about migrate-to-shoehorn

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

FAQPage Schema
How do I replace TypeScript 'as' assertions with safer partial test data?▼

You can migrate TypeScript tests from 'as' assertions to shoehorn helpers by replacing loose type casts with fromPartial, fromAny, or fromExact to enforce type-safe partial data.

What is the shoehorn library used for in TypeScript testing?▼

The shoehorn library validates partial payloads in TypeScript tests without asserting full objects, allowing developers to safely mock large input objects where only a subset of properties matters.

How do I migrate unit tests to use fromPartial for large mock objects?▼

To migrate unit tests, update test imports to use shoehorn helpers like fromPartial, applying them to scenario-based mock data across large objects to replace loose type casts.

Can I use shoehorn helpers to refine tests for TypeScript error scenarios?▼

Yes, shoehorn helpers support refining tests for error scenarios by enabling safer partial data validation, replacing 'as' assertions to maintain readable and type-safe test structures.

Does migrating test data to shoehorn require updating test imports?▼

Yes, migrating test data to shoehorn requires updating test imports to use fromPartial, fromAny, or fromExact where appropriate, ensuring the shoehorn library is installed as a dependency.

When should I migrate from 'as' assertions to fromExact instead of fromPartial?▼

Use fromExact when tests require complete, exact object matching, and fromPartial when validating large objects where only a subset of properties matters, replacing 'as' assertions appropriately.