More benchmarks for the `node:test` module.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 122k
- Forks
- 37.3k
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 283
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in benchmark/test_runner and review the existing benchmarks for it, describe, and the completed test-runner features. Add benchmarks for the unchecked mock.timers, mock.module, snapshot, and coverage cases, using a custom reporter and --expose-internals for coverage. Done means the remaining checklist items are covered without special benchmark logic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- devtools, testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100