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

🚀 Feature: Allow to set timeout on before/after/beforeEach/afterEach in declaration #5202

Open
2 of 3 tasks
perrin4869 opened this issue Aug 27, 2024 · 0 comments
Open
2 of 3 tasks
Labels
status: in triage a maintainer should (re-)triage (review) this issue type: feature enhancement proposal

Comments

@perrin4869
Copy link

Feature Request Checklist

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

@perrin4869 perrin4869 added status: in triage a maintainer should (re-)triage (review) this issue type: feature enhancement proposal labels Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: in triage a maintainer should (re-)triage (review) this issue type: feature enhancement proposal
Projects
None yet
Development

No branches or pull requests

1 participant