Skip to content

Commit 351399f

Browse files
authored
fix(ui): incorrect duration time in vitest ui (#3945)
1 parent dbf0e97 commit 351399f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/ui/client/composables/summary.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ export const testsTodo = computed(() => testsIgnore.value.filter(f => f.mode ===
3434
export const totalTests = computed(() => testsFailed.value.length + testsSuccess.value.length)
3535
export const time = computed(() => {
3636
const t = getTests(tests.value).reduce((acc, t) => {
37-
if (t.result?.duration)
38-
acc += t.result.duration
39-
37+
acc += Math.max(0, t.collectDuration || 0)
38+
acc += Math.max(0, t.setupDuration || 0)
39+
acc += Math.max(0, t.result?.duration || 0)
4040
return acc
4141
}, 0)
4242

0 commit comments

Comments
 (0)