test_runner: pass setup context to global teardown#61726
Open
Han5991 wants to merge 1 commit intonodejs:mainfrom
Open
test_runner: pass setup context to global teardown#61726Han5991 wants to merge 1 commit intonodejs:mainfrom
Han5991 wants to merge 1 commit intonodejs:mainfrom
Conversation
Collaborator
|
Review requested:
|
317cf15 to
e9d71b4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #61726 +/- ##
==========================================
- Coverage 89.73% 89.73% -0.01%
==========================================
Files 675 675
Lines 204525 204531 +6
Branches 39314 39308 -6
==========================================
+ Hits 183523 183528 +5
+ Misses 13300 13284 -16
- Partials 7702 7719 +17
🚀 New features to boost your workflow:
|
pmarchini
reviewed
Feb 8, 2026
e9d71b4 to
04df8a5
Compare
Pass a shared context object to both global hooks so setup and teardown can exchange state without return-value coupling. This keeps the API extensible and aligns the docs and fixtures with the ctx.server lifecycle pattern.
04df8a5 to
e7c4b23
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
globalSetup()intoglobalTeardown(context)in the test runner harnessnode:test.run and CLI global hook suitesglobalSetupreturn values are provided toglobalTeardownTesting
python3 tools/test.py test/parallel/test-runner-run-global-hooks.mjs test/parallel/test-runner-global-setup-teardown.mjs