-
Notifications
You must be signed in to change notification settings - Fork 9
Add test utilities (skip, only, retries) to itParam #14
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
base: master
Are you sure you want to change the base?
Conversation
This took way too much time to discover...
Not sure if/how I should/could test `only` and `retries`.
I finally managed to get the type definitions right, again with a manual and automatic variant. |
I just noticed that everything (defintions & code) concerning |
After some investigation I can only conclude that a couple of things just don't seem to add up.
In case you're unfamiliar with TypeScript, here's a quick (but pretty complete) overview of the language. A summary for the code I linked:
|
Unfortunately it looks like this means that the automatic system won't work, because (as far as I know) there's no way in JS to determine if a function should be wrapped ( What are your thoughts on this matter? |
Title says it all, fixes #6.
This branch is based on #13, meaning it shouldn't be merged until that one's merged. I did this to avoid regressing the this-context shenanigans.
Defining these utility functions can be done manually (3f9f25c) or automatically (6521e2e), since
Object.keys(it)
(currently) returns just these three utility functions. This has the benefit of not having to update when mocha adds another utility function, but could potentially lead to undefined behavior if mocha adds something that is not a utility function.The branch is currently contains the 'automatic' version, if you prefer the manual one I can revert it.
I opened this PR as a draft because I'm still working on the type definitions, unfortunately they're not as straightforward anymore.