Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testType: support defer testing #360

Open
unional opened this issue Sep 4, 2023 · 0 comments
Open

testType: support defer testing #360

unional opened this issue Sep 4, 2023 · 0 comments

Comments

@unional
Copy link
Owner

unional commented Sep 4, 2023

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant