Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue-6168: added leading zero to test runner counter in stats.tsx file #6236

Merged
merged 7 commits into from
Jan 29, 2020
4 changes: 2 additions & 2 deletions packages/reporter/src/header/stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react'
import { StatsStore } from './stats-store'

const count = (num: number) => num > 0 ? num : '--'
const formatDuration = (duration: number) => duration > 0 ? (duration / 1000).toFixed(2) : '0'
const formatDuration = (duration: number) => duration ? String((duration / 1000).toFixed(2)).padStart(5, '0') : '--'

interface Props {
stats: StatsStore
Expand All @@ -28,7 +28,7 @@ const Stats = observer(({ stats }: Props) => (
<span className='num'>{count(stats.numPending)}</span>
</li>
<li className='duration'>
<span className='num'>{count(parseFloat(formatDuration(stats.duration)))}</span>
<span className='num'>{formatDuration(stats.duration)}</span>
</li>
</ul>
))
Expand Down