From 351399f293b4f759b7b479fc8554c382f31625eb Mon Sep 17 00:00:00 2001 From: Dunqing Date: Mon, 14 Aug 2023 19:42:24 +0800 Subject: [PATCH] fix(ui): incorrect duration time in vitest ui (#3945) --- packages/ui/client/composables/summary.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/ui/client/composables/summary.ts b/packages/ui/client/composables/summary.ts index 20c1dcfc1910..18e056779b59 100644 --- a/packages/ui/client/composables/summary.ts +++ b/packages/ui/client/composables/summary.ts @@ -34,9 +34,9 @@ export const testsTodo = computed(() => testsIgnore.value.filter(f => f.mode === export const totalTests = computed(() => testsFailed.value.length + testsSuccess.value.length) export const time = computed(() => { const t = getTests(tests.value).reduce((acc, t) => { - if (t.result?.duration) - acc += t.result.duration - + acc += Math.max(0, t.collectDuration || 0) + acc += Math.max(0, t.setupDuration || 0) + acc += Math.max(0, t.result?.duration || 0) return acc }, 0)