nodejs / nodejs/node

test_runner: todo/skip/expectFailure are truthy per docs, but implementation is otherwise

Open
#61,815 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

never-stale
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:

https://github.com/nodejs/node/blob/2de34822cc9a19621a663e3f22b00b9a01697635/doc/api/test.md?plain=1#L1691-L1696

Additional information

Previous discussions:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.