Skip to content

Doc: Clarify TestContext lifecycle and hook execution order - #64867

Open
Rawal27 wants to merge 3 commits into
nodejs:mainfrom
Rawal27:docs-test-context-lifecycle
Open

Doc: Clarify TestContext lifecycle and hook execution order#64867
Rawal27 wants to merge 3 commits into
nodejs:mainfrom
Rawal27:docs-test-context-lifecycle

Conversation

@Rawal27

@Rawal27 Rawal27 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Improve the TestContext documentation by adding:

  • A TestContext lifecycle section describing when a TestContext instance is created and how it relates to subtests.
  • A small example showing that parent tests and subtests each receive their own TestContext instance.
  • An Execution order section documenting the order in which test hooks are executed.

These additions make the TestContext documentation easier to understand for users who are new to the test runner, while complementing the existing API reference without changing any behavior.

Documentation changes

  • Add TestContext lifecycle
  • Add Example
  • Add Execution order

No functional changes.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. test_runner Issues and PRs related to the test runner subsystem. labels Jul 31, 2026
Signed-off-by: Rawal27 <obviouslykamal@gmail.com>
@Rawal27
Rawal27 force-pushed the docs-test-context-lifecycle branch from 4d0fe06 to 2c89577 Compare July 31, 2026 11:17
Comment thread doc/api/test.md Outdated
Signed-off-by: Rawal27 <obviouslykamal@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Issues and PRs related to the documentations. test_runner Issues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants