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

Any runtime over 1 minute long is formatted oddly #322

Closed
kaiyoma opened this issue Jun 18, 2020 · 3 comments · Fixed by adamgruber/mochawesome-report-generator#148
Closed

Comments

@kaiyoma
Copy link

kaiyoma commented Jun 18, 2020

Describe the bug
Runtimes over 1 minute are formatted like this: 2:24.598m

Expected behavior
This is a weird combination of two different styles of formatting times. If you're going to use the hh:mm:ss format, then you shouldn't have a time unit at the end. The above example should be 2:24.598.

(I would also argue that including milliseconds in this case is unnecessary and just creates extra noise. Can we drop them? Or have an option to drop them?)

Screenshots
image

Environment (please complete the following information):

  • Linux / Windows 10
  • mochawesome 6.1.1
  • mocha 7.2.0
  • Node 12.16.1
@adamgruber
Copy link
Owner

I see your point and I agree that ms are probably unnecessary after 1 minute. However, the unit is there to try to clarify things. If it was just 2:24, it could be construed as 2 hours, 24 minutes. I could display it like 00:02:24 to reduce ambiguity but that's kind of ugly. Thoughts?

@kaiyoma
Copy link
Author

kaiyoma commented Jun 18, 2020

Yes, it could be easy to confuse hh:mm with mm:ss if you weren't used to the UI. One common approach I've seen is to use the one-letter time unit abbreviations, like this:

36s
5m 14s
2h 14m 45s

Those strings are very succinct and unambiguous.

@adamgruber
Copy link
Owner

Seems like a reasonable approach. Thanks for the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants