fix: execute a global hook for all hooking projects #15009
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Hi :)
When specifying a global hook in a multi-project setup, the hook function gets the project configuration passed in second parameter. Its very handy to factorize the global hook definition.
Example of the factorized hook i am using ( long and not interesting but for reference )
With such a system, I am able to have a working configuration whether I run tests from the root of my monorepo or one of the packages, through any tooling, and with the capacity to boot the test environment of each package.
However, the current way of checking which global hook to run does not allow to reuse the same file.
After a lookup I found out this looks like a very simple issue to solve, so I gave it a shot.
Test plan
I've seen some e2e test folder, but I dont know where should I put this ? Can I add a test case to the existing globalHook suite ?
Thanks for your time !