test_runner: files without any tests matching `--test-name-pattern` shouldn't be counted or reported
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 67/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- javascript, node.js
- 领域
- cli, testing-qa
调研方向
首先使用 one.test.js 和 two.test.js 运行报告中的命令,然后检查 test_runner 的实现以及现有的、用于处理 --test-name-pattern 的测试。完成的标准是:没有匹配测试的文件会被省略,并且总数、通过数和持续时间只包含匹配且成功的测试。
由索引模型根据 Issue 内容生成。
描述
Version
v26.3.0
Subsystem
test_runner
What steps will reproduce the bug?
echo "const test = require('node:test'); test('good test', (t) => { t.assert.equal(1, 1) })" > one.test.js
echo "const test = require('node:test'); test('bad test', (t) => { t.assert.equal(1, 2) })" > two.test.js
node --test --test-name-pattern=good *.test.js
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
✔ good test (0.963084ms)
ℹ tests 1
ℹ suites 0
ℹ pass 1
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 0.963084ms
The file two.test.js does not contain a single test that matches the --test-name-pattern, so should be skipped entirely, i.e. treated as if it doesn't exist.
What do you see instead?
✔ good test (0.963084ms)
✔ two.test.js (61.52275ms) <-- file with no matching tests reported (by file name) as passing
ℹ tests 2 <-- should be 1 test
ℹ suites 0
ℹ pass 2 <-- should be 1 pass
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 68.503541 <-- should be 0.963084ms
- 主要语言
- JavaScript
- 星标
- 122k
- 派生
- 37.4k
- 平均合并
- 4 天 4 小时
- 30 天内合并 PR
- 276
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nodejs/node 的其他 Issue
-
doc
难度 2/5 1-3 小时 新手友好度 65/100
-
build
难度 1/5 1 小时以内 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 1/5 1 小时以内 新手友好度 90/100
-
feature request
难度 2/5 1-3 小时 新手友好度 68/100
相似的 Issue
-
bot:ai-assisted component:compact-js status:untriaged
难度 2/5 1-3 小时 新手友好度 84/100
midnightntwrk/midnight-sdk#403 ·
-
难度 1/5 1 小时以内 新手友好度 92/100
-
难度 1/5 1-3 小时 新手友好度 86/100
DavidAnson/markdownlint-cli2#940 ·
-
documentation
难度 2/5 1-3 小时 新手友好度 88/100
githubnext/gh-aw-workshop#3692 ·
-
agent/guide documentation hive/hosted-available-lke648397-260827-5n31
难度 2/5 1-3 小时 新手友好度 90/100