What problem does it solve?
This Skill solves the problem of using unsafe as type assertions in TypeScript test files, which require manual type specification, double casting for intentionally incorrect test data, and faking all properties of large objects even when only a subset are needed, leading to brittle, hard-to-maintain test code.
Core Features & Use Cases
- Type-safe partial test data: Replaces as Type assertions with the fromPartial() function to pass only required properties of large objects without faking unused fields.
- Intentional incorrect type handling: Replaces double as unknown as Type casts with the fromAny() function for test cases requiring intentionally wrong data, while retaining autocomplete support.
- Use Case: For a test that only needs the body.id property of a Request object with 20+ additional properties, this Skill eliminates the need to manually define all unused properties in test setup.
Quick Start
Use this skill to replace all as type assertions in your TypeScript test files with type-safe @total-typescript/shoehorn functions to reduce boilerplate and improve test maintainability.