-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
status: accepting prsMocha can use your help with this one!Mocha can use your help with this one!type: featureenhancement proposalenhancement proposal
Description
Feature Request Checklist
- I have read and agree to Mocha's Code of Conduct and Contributing Guidelines
- I have searched for related issues and issues with the
faq
label, but none matched my issue. - I want to provide a PR to resolve this
Overview
it
returns a TestFunction
that has a timeout
method. This is useful for setting timeouts in slow tests, without needing to define the test code inside a function() {}
block.
An analogous feature would be useful for the before/beforeEach/after/afterEach
hooks. The current workaround would be:
before(function() {
this.timeout(3000);
});
Suggested Solution
before/beforeEach/after/afterEach
could return a HookFunction
, analogous to TestFunction
, which has a timeout
method. The code above could be rewritten:
before(() => {}).timeout(3000);
Alternatives
None
Additional Info
No response
Metadata
Metadata
Assignees
Labels
status: accepting prsMocha can use your help with this one!Mocha can use your help with this one!type: featureenhancement proposalenhancement proposal