Skip to content

Commit c475504

Browse files
feat(vitest): call setup and teardown when running suite
1 parent 6df11e8 commit c475504

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/vitest-plugin/src/runner.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ async function runBench(benchmark: Benchmark, currentSuiteName: string) {
8383
}
8484

8585
async function runBenchmarkSuite(suite: Suite, parentSuiteName?: string) {
86+
await callSuiteHook(suite, suite, "setup");
87+
8688
const currentSuiteName = parentSuiteName
8789
? parentSuiteName + "::" + suite.name
8890
: suite.name;
@@ -108,6 +110,8 @@ async function runBenchmarkSuite(suite: Suite, parentSuiteName?: string) {
108110
if (parentSuiteName !== undefined) {
109111
await callSuiteHook(suite, suite, "afterAll");
110112
}
113+
114+
await callSuiteHook(suite, suite, "teardown");
111115
}
112116

113117
function patchRootSuiteWithFullFilePath(suite: Suite) {

0 commit comments

Comments
 (0)