Skip to content

Commit

Permalink
test_runner: fixed test shorthands return type
Browse files Browse the repository at this point in the history
`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: nodejs#48557
  • Loading branch information
shockerqt committed Jun 27, 2023
1 parent b38bc9f commit 6068403
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/internal/test_runner/harness.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6068403

Please sign in to comment.