test_runner: todo/skip/expectFailure are truthy per docs, but implementation is otherwise
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 122k
- Forks
- 37.3k
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 283
Description
Version
v25.6.1
Subsystem
node:test
What steps will reproduce the bug?
Add the todo, skip or testFailure option to a test, setting it to an empty string. The result will be the same as if you set it to true or a non-empty string.
What is the expected behavior? Why is that the expected behavior?
Unsure whether the bug is in the code or in the API docs.
The code clearly does not treat these options as truthy:
https://github.com/nodejs/node/blob/2de34822cc9a19621a663e3f22b00b9a01697635/lib/internal/test_runner/test.js#L639-L641
But the docs specifically state they should be:
Additional information
Previous discussions:
- Three years ago: https://github.com/nodejs/node/pull/47537#pullrequestreview-1383887199 @ljharb
- More recently as part of
expectFailuredevelopment: https://github.com/nodejs/test-runner/pull/10#discussion_r2739831598 @JakobJingleheimer
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/internal/test_runner/test.js around lines 639-641 and the option descriptions in doc/api/test.md around lines 1691-1696. Review the linked discussions to determine whether empty strings should be treated as enabled or whether the documentation is wrong. Done means the documentation and implementation agree, with coverage for empty, true, and non-empty values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100