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:
|
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:
|
* `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: