Open
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
(test_runner: run single test file benchmark #56479) - Create a
test
when 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
(benchmark: addtest_runner/mock-fn
#55771) -
mock.timers
for 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