Commit 5ab201e
committed
fix: prevent duplicate bench result table for top-level bench() calls
Fixes #9718
When bench() is used at the top level of a file (outside any describe()),
runBenchmarkSuite emitted suite-finished for the file root after running
its benchmark tasks. The general runSuite wrapper that calls runner.runSuite()
also unconditionally emits suite-finished for the file after returning,
resulting in two suite-finished events → two onTestModuleEnd calls →
two printSuiteTable invocations.
Skip emitting suite-finished in runBenchmarkSuite when suite.file === suite
(i.e. the suite is the file root). The general wrapper already handles
this event at the file level. For describe-level suites, suite.file !== suite,
so they continue to emit normally.1 parent 36a6fd8 commit 5ab201e
1 file changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
144 | 150 | | |
145 | 151 | | |
146 | 152 | | |
| |||
0 commit comments