-
-
Notifications
You must be signed in to change notification settings - Fork 34.8k
Open
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:
node/lib/internal/test_runner/test.js
Lines 639 to 641 in 2de3482
| this.expectFailure = expectFailure !== undefined && expectFailure !== false; | |
| this.skipped = skip !== undefined && skip !== false; | |
| this.isTodo = (todo !== undefined && todo !== false) || this.parent?.isTodo; |
But the docs specifically state they should be:
Lines 1691 to 1696 in 2de3482
| * `skip` {boolean|string} If truthy, the test is skipped. If a string is | |
| provided, that string is displayed in the test results as the reason for | |
| skipping the test. **Default:** `false`. | |
| * `todo` {boolean|string} If truthy, the test marked as `TODO`. If a string | |
| is provided, that string is displayed in the test results as the reason why | |
| the test is `TODO`. **Default:** `false`. |
Additional information
Previous discussions:
- Three years ago: test_runner: fix spec skip detection #47537 (review) @ljharb
- More recently as part of
expectFailuredevelopment: doc(proposal):expectFailurelabel and/or matcher test-runner#10 (comment) @JakobJingleheimer
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels