BUPKIS
    Preparing search index...

    Type Alias SubjectUnionForOverlap<AllAssertions, Parts>

    SubjectUnionForOverlap: AllAssertions extends InvariantOf<
        infer U extends AnyAssertion,
    >
        ? U["parts"] extends AssertionParts
            ? [LeadingPhraseFromParts<Parts> & LeadingPhraseFromParts<U["parts"]>] extends [
                never,
            ]
                ? never
                : ParamsOverlap<ExpectItParams<Parts>, ExpectItParams<U["parts"]>> extends true
                    ? U["parts"][0] extends StandardSchemaV1<infer Input>
                        ? Input
                        : unknown
                    : never
            : never
        : never

    Union of subject-input types drawn from every assertion in AllAssertions that share a leading phrase with Parts and take overlapping parameters.

    When two assertions share a leading phrase (for example functionResolveAssertion and promiseResolveAssertion both accept 'to resolve'), the runtime .it('to resolve') executor dispatches to whichever matches the actual subject shape. This type mirrors that reality at the type level by widening the subject to a union of every possible input.

    A shared phrase alone is not enough: the numeric and string assertions both own 'to be greater than', but .it('to be greater than', 5) can only ever be satisfied by the numeric one. Siblings whose parameters cannot overlap with those of Parts are therefore excluded.

    This works per overload rather than per call, so an assertion with several aliases still matches siblings that share any one of them. Narrowing by the alias actually typed would need a signature generic over the call's arguments, which breaks inference when .it() is nested inline in another call's arguments (e.g. expect(x, 'to satisfy', { a: expect.it(...) })).

    Type Parameters

    • AllAssertions extends AnyAssertion

      Full assertion union to scan

    • Parts extends AssertionParts

      Parts of the assertion whose overload is being typed