Skip to content

testType: support defer testing #360

@unional

Description

@unional

currently, testType.* can be used in test directly. e.g.:

it('blah', () => {
  testType.equal<A, B>(true)
}

However, when the tests get complicates or when there are may duplication, you would like to extract part of the test and reuse it:

it('blah', () => {
  testMyType(...)
}

it('bruh', () => {
  testMyType(...)
}

testMyType(...) {
  testType....
}

Since testType.* are 💥 immediate, they can't be used this way.

Not sure if there is a way to achieve this a the library level as this is crossing the type-value boundary (i.e. fail type throws Error)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions