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

feat: allow calling hook methods #5231

Merged

Conversation

perrin4869
Copy link
Contributor

@perrin4869 perrin4869 commented Oct 14, 2024

PR Checklist

Overview

It seems the only reason this wasn't supported was simply the return value of calling beforeAll, etc, was not the hook itself, unlike the result of calling a function like describe, which does use the suite as the return value.
I will look into adding tests and maybe some docs

Copy link

linux-foundation-easycla bot commented Oct 14, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commented Oct 30, 2024

By the way, a tip: the template has a place to put the Closes #5202. 🙂

I edited it in just now.

@perrin4869
Copy link
Contributor Author

oh oops, sorry about that 😅
thanks for editing!
hm... maybe the failure is a flakey test here?

@JoshuaKGoldberg
Copy link
Member

Looks like it! I re-ran the CI job and it's all passing. Phew 😄

@perrin4869
Copy link
Contributor Author

was getting worried there for a sec!

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me, thanks! 🙌

lib/suite.js Outdated Show resolved Hide resolved
docs/index.md Outdated Show resolved Hide resolved
@JoshuaKGoldberg JoshuaKGoldberg changed the title feat(suite): allow calling hook methods feat: allow calling hook methods Oct 30, 2024
@JoshuaKGoldberg JoshuaKGoldberg merged commit e3da641 into mochajs:main Oct 30, 2024
104 checks passed
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

Successfully merging this pull request may close these issues.

🚀 Feature: Allow to set timeout on before/after/beforeEach/afterEach in declaration
2 participants