Test Runner docs could use more information on the concept of a Suite
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 122k
- 派生
- 37.4k
- 平均合并
- 4 天 3 小时
- 30 天内合并 PR
- 272
描述
Affected URL(s)
https://nodejs.org/docs/latest-v24.x/api/test.html
Description of the problem
The test runner docs could use more information regarding suites. Suites do behave subtly differently to a test with subtests. Documenting these difference is important.
For example, comparing and contrasting the difference in:
suite('s1', () => {
test('t1', () => {
assert.ok(true);
});
test('t2', () => {
assert.ok(true);
});
});
And then the equivalent:
test('s1', async (ctx) => {
await ctx.test('t1', () => {
assert.ok(true);
});
await ctx.test('t2', () => {
assert.ok(true);
});
});
I'm sure there is more details to mention too but this comparison stands out the most to me.
It also feels like the docs are missing this section because as you read the page top-to-bottom, you get to the Subtests section and it mentions:
This is necessary because tests do not wait for their subtests to complete, unlike tests created within suites.
Without ever actually introducing what a "suite" is.
I understand the concept of a "suite" is generally well understood in the context of a any test runner, but nonetheless the specifics for Node's version of it is important to detail as devs work to convert from other testing frameworks where they may be familiar with different assumptions for what a "suite" vs "test" is.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从受影响 URL 上的 Test Runner 文档开始,重点查看 Subtests 部分及其中对 suites 的引用。比较 issue 中的 suite 和 nested-test 示例,然后记录 Node.js suite 是什么,以及它的行为与带有 subtests 的测试有何不同;完成的标准是读者能在 Subtests 部分之前看到此说明。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- documentation
- Issue 类型
- 文档
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 70/100