Skip to content

Commit

Permalink
fix: address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
LuciNyan committed Aug 27, 2024
1 parent 051c652 commit bf57d53
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/runner/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export async function runTest(test: Test | Custom, runner: VitestRunner): Promis

test.result = {
state: 'run',
startTime: Date.now(),
startTime: start,
retryCount: 0,
}
updateTask(test, runner)
Expand Down Expand Up @@ -376,7 +376,7 @@ export async function runSuite(suite: Suite, runner: VitestRunner): Promise<void

suite.result = {
state: 'run',
startTime: Date.now(),
startTime: start,
}

updateTask(suite, runner)
Expand Down
7 changes: 0 additions & 7 deletions test/cli/test/reported-tasks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type { WorkspaceProject } from 'vitest/node'
import { runVitest } from '../../test-utils'
import type { TestCase, TestCollection, TestModule } from '../../../packages/vitest/src/node/reporters/reported-tasks'

const now = new Date()
// const finishedFiles: File[] = []
const collectedFiles: RunnerTestFile[] = []
let state: StateManager
Expand Down Expand Up @@ -103,7 +102,6 @@ it('correctly reports a passed test', () => {
expect(diagnostic).toBeDefined()
expect(diagnostic.heap).toBeGreaterThan(0)
expect(diagnostic.duration).toBeGreaterThan(0)
expect(date(new Date(diagnostic.startTime))).toBe(date(now))
expect(diagnostic.flaky).toBe(false)
expect(diagnostic.repeatCount).toBe(0)
expect(diagnostic.repeatCount).toBe(0)
Expand Down Expand Up @@ -150,7 +148,6 @@ it('correctly reports failed test', () => {
expect(diagnostic).toBeDefined()
expect(diagnostic.heap).toBeGreaterThan(0)
expect(diagnostic.duration).toBeGreaterThan(0)
expect(date(new Date(diagnostic.startTime))).toBe(date(now))
expect(diagnostic.flaky).toBe(false)
expect(diagnostic.repeatCount).toBe(0)
expect(diagnostic.repeatCount).toBe(0)
Expand Down Expand Up @@ -217,10 +214,6 @@ it('correctly passed down metadata', () => {
expect(meta).toHaveProperty('key', 'value')
})

function date(time: Date) {
return `${time.getDate()}/${time.getMonth() + 1}/${time.getFullYear()}`
}

function deepFind(children: TestCollection, name: string): TestCase | undefined {
for (const task of children) {
if (task.type === 'test') {
Expand Down

0 comments on commit bf57d53

Please sign in to comment.