From 60684039cc778a8dbe28a2e1bcad7d9bedfbec3a Mon Sep 17 00:00:00 2001 From: Shocker <43253032+shockerqt@users.noreply.github.com> Date: Sun, 25 Jun 2023 23:47:06 -0400 Subject: [PATCH] test_runner: fixed `test` shorthands return type `test.todo`, `test.only` and `test.skip` are expected to return the same as `test`. This commit corrects the inconsistent behavior of these shorthands. Fixes: https://github.com/nodejs/node/issues/48557 --- lib/internal/test_runner/harness.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/internal/test_runner/harness.js b/lib/internal/test_runner/harness.js index f150a8f5ed85c2..246620f6628d88 100644 --- a/lib/internal/test_runner/harness.js +++ b/lib/internal/test_runner/harness.js @@ -216,9 +216,7 @@ function runInParentContext(Factory) { const test = (name, options, fn) => run(name, options, fn); ArrayPrototypeForEach(['skip', 'todo', 'only'], (keyword) => { - test[keyword] = (name, options, fn) => { - run(name, options, fn, { [keyword]: true }); - }; + test[keyword] = (name, options, fn) => run(name, options, fn, { [keyword]: true }); }); return test; }