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

Investigate custom, TypeScript-specific assertions #21

Closed
novemberborn opened this issue Apr 14, 2020 · 0 comments
Closed

Investigate custom, TypeScript-specific assertions #21

novemberborn opened this issue Apr 14, 2020 · 0 comments
Labels
question Further information is requested

Comments

@novemberborn
Copy link
Member

Coming out of discussions in avajs/ava#2449 we may want to consider supporting additional assertions for use with TypeScript. Say a t.guard(obj, fn) which can be used in an if condition:

if (t.guard(fooOrBar, isFoo)) {
  // Do stuff know that we know fooOrBar is Foo
}

Of course AVA does not support custom assertions yet, but keep an eye on avajs/ava#2435.

We'll also have to consider how you might import a test function that has these assertions installed.

@novemberborn novemberborn added the question Further information is requested label Apr 14, 2020
@novemberborn novemberborn changed the title Investigate custom, TypeScript specific assertions Investigate custom, TypeScript-specific assertions Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant