GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test_runner: do not invoke after hook when test is empty by marco-ippolito · Pull Request #51389 · nodejs/node

Conversation

@marco-ippolito

@marco-ippolito marco-ippolito commented Jan 5, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Fixes: #51371
(recreated because apparently if you force push on a closed PR it cannot be reopened)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@marco-ippolito
test_runner: do not invoke after hook when test is empty
08acf85
@nodejs-github-bot

nodejs-github-bot commented Jan 5, 2024

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Jan 5, 2024
lpinca
lpinca approved these changes Jan 6, 2024
View reviewed changes
Comment thread test/parallel/test-runner-skip-after-hook.js
Comment on lines +6 to +10
test('test', async (t) => {
t.after(common.mustNotCall(() => {
t.fail('should not run');
}));
});

@lpinca lpinca Jan 6, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
test('test', async (t) => {
t.after(common.mustNotCall(() => {
t.fail('should not run');
}));
});
test('test', (t) => {
t.after(common.mustNotCall());
});

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@lpinca lpinca added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jan 6, 2024
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Jan 6, 2024
@nodejs-github-bot

nodejs-github-bot commented Jan 6, 2024

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/56694/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marco-ippolito marco-ippolito added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Jan 7, 2024
atlowChemi
atlowChemi approved these changes Jan 7, 2024
View reviewed changes
@marco-ippolito marco-ippolito added the commit-queue PRs queued for automated landing through the Commit Queue. label Jan 8, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Jan 8, 2024
@nodejs-github-bot
nodejs-github-bot merged commit a53fd95 into nodejs:main Jan 8, 2024
@nodejs-github-bot

nodejs-github-bot commented Jan 8, 2024

Copy link
Copy Markdown
Collaborator

Landed in a53fd95

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

marco-ippolito added a commit to marco-ippolito/node that referenced this pull request Jan 12, 2024
@marco-ippolito
test_runner: do not invoke after hook when test is empty
a1852d2
PR-URL: nodejs#51389
Fixes: nodejs#51371
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Medhansh404 pushed a commit to Medhansh404/node that referenced this pull request Jan 19, 2024
@marco-ippolito @Medhansh404
test_runner: do not invoke after hook when test is empty
c9e0506
PR-URL: nodejs#51389
Fixes: nodejs#51371
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
targos pushed a commit that referenced this pull request Feb 15, 2024
@marco-ippolito @targos
test_runner: do not invoke after hook when test is empty
e0789fb
PR-URL: #51389
Fixes: #51371
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
@marco-ippolito marco-ippolito mentioned this pull request Mar 1, 2024
v21.7.0 proposal #51932
Merged
@KhafraDev KhafraDev mentioned this pull request Mar 7, 2024
test_runner: t.after is never called #51997
Closed
@richardlau richardlau added dont-land-on-v18.x labels Mar 7, 2024
@richardlau

richardlau commented Mar 7, 2024

Copy link
Copy Markdown
Member

This is being reverted in #51998

marco-ippolito reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

targos added a commit that referenced this pull request Mar 7, 2024
@targos
2024-03-08, Version 21.7.1 (Current)
67c970d
Notable changes:

This release reverts #51389,
which landed in Node.js 21.7.0. It is a documented feature that
`t.after()` hooks are run even if a test has no subtests. The hook can
be used to clean up the test itself.

PR-URL: #52002
@targos targos mentioned this pull request Mar 7, 2024
v21.7.1 release proposal #52002
Merged
@MoLow MoLow mentioned this pull request Mar 7, 2024
test_runner: run before hook immediately if test started #52003
Merged
targos added a commit that referenced this pull request Mar 8, 2024
@targos
2024-03-08, Version 21.7.1 (Current)
84c7e6f
Notable changes:

This release reverts #51389,
which landed in Node.js 21.7.0. It is a documented feature that
`t.after()` hooks are run even if a test has no subtests. The hook can
be used to clean up the test itself.

PR-URL: #52002
targos added a commit that referenced this pull request Mar 8, 2024
@targos
2024-03-08, Version 21.7.1 (Current)
fd511fb
Notable changes:

This release reverts #51389,
which landed in Node.js 21.7.0. It is a documented feature that
`t.after()` hooks are run even if a test has no subtests. The hook can
be used to clean up the test itself.

PR-URL: #52002
@marco-ippolito marco-ippolito mentioned this pull request May 29, 2024
test_runner: before hook runs even if it's not followed by any test #53202
Closed
@robobun robobun mentioned this pull request Nov 10, 2026
bun test: run no beforeAll/afterAll inside an aroundAll that doesn't run oven-sh/bun#48455
Draft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@lpinca lpinca lpinca approved these changes
@atlowChemi atlowChemi atlowChemi approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

test_runner: after() hook is called for no subtests

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@marco-ippolito @nodejs-github-bot @richardlau @lpinca @atlowChemi
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.