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

Type context of spec and assertion functions #9

Open
demurgos opened this issue Jan 1, 2017 · 1 comment
Open

Type context of spec and assertion functions #9

demurgos opened this issue Jan 1, 2017 · 1 comment

Comments

@demurgos
Copy link

demurgos commented Jan 1, 2017

Mocha sets the value of the this variable for the functions passed to describe and test/it.
This allows to dynamically configure the behaviour of the tests (skip tests, define timeout, ...)

Their website mentions the following methods:

  • this.skip
  • this.retries
  • this.slow
  • this.timeout

I wasn't able to find a "structured" API documentation. There are more methods available when checking the source code, but supporting only the documented methods would be a good start.

@felixfbecker
Copy link

I would like to see a generic overload like this

it<C extends object>(this: C & TestContext, ...)

to be able to type the test context that is expected

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

2 participants