More benchmarks for the `node:test` module.
未关闭
还没有人认领这个 Issue。
benchmark
test_runner
- 主要语言
- JavaScript
- 星标
- 122k
- 派生
- 37.4k
- 平均合并
- 4 天 3 小时
- 30 天内合并 PR
- 272
描述
The benchmark/test_runner folder currently contains benchmarks for it and describe functions. I suggest we expand these benchmarks to cover additional test runner features, including mocks, coverage, and various test modes.
Here are the functions that (IMO) should be benchmarked:
Basic Testing
These tests should run with a custom reporter without any special logic to make the tests as accurate as possible.
-
test- Create a
test(#56479) - Create a
testwhen it's not running due toonly - Add a subtest
- Skip a test
- Via
skip: true - Via
t.skip() - Via
t.skip(...)
- Via
- TODO tests
- Via
todo: true - Via
t.todo() - Via
t.todo(...)
- Via
- Create a
Hooks
-
beforeEach -
afterEach -
before -
after
Reporters (#55757)
-
dot -
junit -
spec -
tap -
lcov
Mocking
-
mock.fn(#55771) -
mock.timersfor each API, and each sub-function -
mock.module
Snapshots
-
snapshot.setDefaultSnapshotSerializers(serializers) -
snapshot.setResolveSnapshotPath(fn) -
t.assert.snapshot
Coverage
Use --expose-internals to exclusively test the coverage part
- Basic
- Excluding files
- Including files
- With source maps
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 benchmark/test_runner 开始,检查 it、describe 以及已完成的 test-runner 功能对应的现有基准测试。为尚未勾选的 mock.timers、mock.module、snapshot 和 coverage 用例添加基准测试,并为 coverage 使用自定义 reporter 和 --expose-internals。剩余的检查清单项目都在不使用特殊基准测试逻辑的情况下得到覆盖,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, node.js
- 领域
- devtools, testing-qa
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 52/100