test_runner: todo/skip/expectFailure are truthy per docs, but implementation is otherwise
未关闭
还没有人认领这个 Issue。
never-stale
- 主要语言
- JavaScript
- 星标
- 122k
- 派生
- 37.4k
- 平均合并
- 4 天 3 小时
- 30 天内合并 PR
- 272
描述
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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
先查看 lib/internal/test_runner/test.js 约第 639-641 行,以及 doc/api/test.md 约第 1691-1696 行的选项说明。审阅链接的讨论,以确定空字符串是否应被视为已启用,或者文档是否有误。完成标准是文档与实现一致,并且覆盖空值、true 和非空值。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, node.js
- 领域
- testing-qa
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 冷清
- 描述清晰度
- 需要澄清
- 新手友好度
- 35/100