-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
test runner: dors the after hook run After failure ? #50901
Comments
Hooks are executed even if tests fail. PRs to documentation are welcomed |
The `after` hook now explicitly mentions that it is executed once after all the tests in a test suite have completed, regardless of whether the tests passed or failed. This ensures that cleanup tasks or actions specified in the after hook are guaranteed to run. Refs: nodejs#50901
The `afterEach` hook is now documented to be executed after each individual test in a test suite, irrespective of whether the test passed or failed. Developers can rely on this hook for performing cleanup or resetting state after each test. Refs: nodejs#50901
Refined the language in the documentation for the `after` and `afterEach` hooks to enhance clarity. Replaced instances of "note that" with more direct and concise language for better readability. Refs: nodejs#50901
Hello everyone 👋 I'm excited to share that I've addressed the concerns raised in this issue regarding the documentation for the As a first-time contributor to the Node.js (runtime), I'm thrilled to be a part of this amazing community. I've ensured that the changes adhere to the project's documentation style guide and have addressed linting warnings for improved clarity. Feel free to review the pull request, provide feedback, or let me know if there's anything else I can do to enhance the contribution. I'm looking forward to being a more active part of the Node.js community! 🙂 |
Refined the documentation for the `after` and `afterEach` hooks to enhance clarity. Removed redundant information and retained the essential details. The revised note now explicitly states that the `after` and `afterEach` hooks are guaranteed to run, even if tests within the suite fail. Refs: nodejs#50901
Adjusted line lengths in the documentation to adhere to the maximum allowed limit of 80 characters. This change resolves the linting error. Refs: nodejs#50901
The `after` hook now explicitly mentions that it is executed once after all the tests in a test suite have completed, regardless of whether the tests passed or failed. This ensures that cleanup tasks or actions specified in the after hook are guaranteed to run. Refs: #50901 PR-URL: #51523 Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
The `after` hook now explicitly mentions that it is executed once after all the tests in a test suite have completed, regardless of whether the tests passed or failed. This ensures that cleanup tasks or actions specified in the after hook are guaranteed to run. Refs: nodejs#50901 PR-URL: nodejs#51523 Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
The `after` hook now explicitly mentions that it is executed once after all the tests in a test suite have completed, regardless of whether the tests passed or failed. This ensures that cleanup tasks or actions specified in the after hook are guaranteed to run. Refs: #50901 PR-URL: #51523 Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
The `after` hook now explicitly mentions that it is executed once after all the tests in a test suite have completed, regardless of whether the tests passed or failed. This ensures that cleanup tasks or actions specified in the after hook are guaranteed to run. Refs: nodejs#50901 PR-URL: nodejs#51523 Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
Fixed by #51523 |
The `after` hook now explicitly mentions that it is executed once after all the tests in a test suite have completed, regardless of whether the tests passed or failed. This ensures that cleanup tasks or actions specified in the after hook are guaranteed to run. Refs: #50901 PR-URL: #51523 Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
The `after` hook now explicitly mentions that it is executed once after all the tests in a test suite have completed, regardless of whether the tests passed or failed. This ensures that cleanup tasks or actions specified in the after hook are guaranteed to run. Refs: #50901 PR-URL: #51523 Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
Affected URL(s)
https://nodejs.org/api/test.html#afterfn-options
Description of the problem
In the document,it is unclear wether the after hook is run when the test did failed.
Same for the afterEach hook.
The text was updated successfully, but these errors were encountered: