From 7a45ae509aac42ee4957e37cc34b79f69bbd9b7f Mon Sep 17 00:00:00 2001 From: Zixuan Chen Date: Sun, 13 Mar 2022 17:11:17 +0800 Subject: [PATCH] refactor: move expr --- packages/vitest/src/runtime/run.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/vitest/src/runtime/run.ts b/packages/vitest/src/runtime/run.ts index 4299b72042bb..4726f6508e76 100644 --- a/packages/vitest/src/runtime/run.ts +++ b/packages/vitest/src/runtime/run.ts @@ -67,11 +67,11 @@ export async function runTest(test: Test) { return } - const startDate = Date.now() const start = performance.now() test.result = { state: 'run', + startTime: Date.now(), } updateTask(test) @@ -128,7 +128,6 @@ export async function runTest(test: Test) { getSnapshotClient().clearTest() - test.result.startTime = startDate test.result.duration = performance.now() - start __vitest_worker__.current = undefined @@ -152,11 +151,11 @@ export async function runSuite(suite: Suite) { return } - const startDate = Date.now() const start = performance.now() suite.result = { state: 'run', + startTime: Date.now(), } updateTask(suite) @@ -188,7 +187,6 @@ export async function runSuite(suite: Suite) { } } suite.result.duration = performance.now() - start - suite.result.startTime = startDate if (suite.mode === 'run') { if (!hasTests(suite)) {