Skip to content

feat: add NoInfer support to callable matchers #50

Description

@martyy-code

Description

Add support for the TypeScript NoInfer marker in callable/constructible matchers. The NoInfer utility type (TS 5.4+) prevents TypeScript from inferring a type parameter from a specific position, which is a common pattern in generic APIs.

GitHub issue expect-type #196 tracks the same gap.

Why

Many typed APIs use NoInfer to control inference. If our callable matchers don't handle it, tests silently pass when they should fail. The pattern is especially common in builder/factory APIs.

Acceptance criteria

  • toBeCallableWith handles NoInfer in argument positions
  • toBeConstructibleWith handles NoInfer in constructor arguments
  • Tests verify that NoInfer correctly prevents inference

Risks

  • Medium. NoInfer interaction with complex generics can be subtle. May need a dedicated type utility.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:typesType utilities (Equal, IsAny, IsNever, ...)enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions