Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
test_runner: todo/skip/expectFailure are truthy per docs, but implementation is otherwise | GoodFirstPicks

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

nodejs/node 3 comments 1mo ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeTest focusedNode.jsJavaScript

Why this is a good first issue

Inconsistency between implementation and documentation for test options.

AI Summary

The issue highlights a discrepancy between the implementation and documentation of `todo`, `skip`, and `expectFailure` options in the test runner. The implementation does not treat these options as truthy, contrary to the documentation. The task involves resolving this inconsistency, either by updating the code or the documentation, but the correct approach is unclear.

Issue 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:

  • Three years ago: https://github.com/nodejs/node/pull/47537#pullrequestreview-1383887199 @ljharb
  • More recently as part of expectFailure development: https://github.com/nodejs/test-runner/pull/10#discussion_r2739831598 @JakobJingleheimer

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!

Risk Flags

  • API documentation inconsistency
  • potential breaking change
Loading labels...

Details

Points20 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedyes