[Bug]: Hooks for before/after the entire suite
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 11.7k
- Forks
- 538
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 8
Description
What Happened
Docs say
In addition, you can define global hooks that will run before or after your entire test suite, regardless of the folder or group.
but after wasting a few hours I wasn't able to find a single working solution for it, much less a simple and straightforward one for such a primitive requirement.
How to Reproduce
Just try to run a hook before/after running the entire suite.
Sample Repository
No response
Pest Version
4.1.3
PHP Version
8.3.27
Operation System
macOS
Notes
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the global-hooks documentation and reproduce the reported behavior using Pest 4.1.3 on PHP 8.3.27. Trace how suite-wide hooks are registered and executed, then verify that a before or after hook runs for the entire suite regardless of folder or group and that the documentation describes the working solution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100