-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: avoid running twice tests in describe #46888
Conversation
Review requested:
|
d9021c1
to
e3c44e3
Compare
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.
I'm not too sure if returning undefined
is the correct move (rather than a PromiseResolve()
), is there some use case when it would be useful for the users to make the difference?
Other than that, I think I would word the commit as avoid running tests twice
, but I'm not an English native speaker, so if the current order is correct, I'm fine with it :)
returning a |
That sounds less confusing an API to me than one that only sometimes returns a Promise - the latter is literally what's referred to as "zalgo". |
2c235f2
to
95d8d57
Compare
@nodejs/test_runner since this is a bug in main I'd like to land it, additional reviews/approvals will be appreciated |
} | ||
|
||
function runInParentContext(Factory) { | ||
function runInParentContext(Factory, addShorthands = true) { | ||
function run(name, options, fn, overrides) { |
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.
function run(name, options, fn, overrides) { | |
async function run(name, options, fn, overrides) { |
doing this instead would ensure it always returns a promise
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.
@ljharb change has caused invalid arguments to reject instead of throw so I will revert this
fec80e6
to
95d8d57
Compare
Commit Queue failed- Loading data for nodejs/node/pull/46888 ✔ Done loading data for nodejs/node/pull/46888 ----------------------------------- PR info ------------------------------------ Title test_runner: avoid running twice tests in describe (#46888) Author Moshe Atlow (@MoLow) Branch MoLow:fix-test-in-describe -> nodejs:main Labels author ready, needs-ci, dont-land-on-v14.x, test_runner Commits 1 - test_runner: avoid running twice tests in describe Committers 1 - Moshe Atlow PR-URL: https://github.com/nodejs/node/pull/46888 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Antoine du Hamel ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/46888 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Antoine du Hamel -------------------------------------------------------------------------------- ℹ This PR was created on Tue, 28 Feb 2023 20:30:39 GMT ✔ Approvals: 2 ✔ - Benjamin Gruenbaum (@benjamingr): https://github.com/nodejs/node/pull/46888#pullrequestreview-1320288015 ✔ - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/46888#pullrequestreview-1322529537 ✖ Last GitHub CI failed ℹ Last Full PR CI on 2023-03-02T22:06:27Z: https://ci.nodejs.org/job/node-test-pull-request/50173/ - Querying data for job/node-test-pull-request/50173/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/4320318363 |
PR-URL: #46888 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
Landed in a37b72d |
PR-URL: #46888 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
PR-URL: #46888 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
PR-URL: #46888 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
Fixes #46887
not the fix itself can be understood in the first commit, the second one just unifies the code,
wanted to make review easier so split into two commits