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

Fix time duration formatting as per SI #9765

Merged
merged 1 commit into from May 2, 2020

Conversation

getsnoopy
Copy link
Contributor

Summary

This commit fixes the formatting of time durations to have a spcae
between the quantity and the unit symbol which is compliant with
the SI. It also consolidates all of the time duration formatting
code into formatTime() in jest-util to keep the code DRY and so
that future updates are easy.

Test plan

yarn jest formatTime

@getsnoopy getsnoopy force-pushed the fix-time-formatting branch 2 times, most recently from f5507db to a6e5573 Compare April 4, 2020 06:33
@codecov-io
Copy link

codecov-io commented Apr 4, 2020

Codecov Report

Merging #9765 into master will increase coverage by 0.03%.
The diff coverage is 63.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9765      +/-   ##
==========================================
+ Coverage   64.53%   64.56%   +0.03%     
==========================================
  Files         290      291       +1     
  Lines       12321    12326       +5     
  Branches     3048     3048              
==========================================
+ Hits         7951     7958       +7     
+ Misses       3730     3729       -1     
+ Partials      640      639       -1     
Impacted Files Coverage Δ
packages/jest-circus/src/utils.ts 14.72% <0.00%> (ø)
packages/jest-jasmine2/src/queueRunner.ts 100.00% <ø> (ø)
packages/jest-reporters/src/get_result_header.ts 47.61% <0.00%> (ø)
packages/jest-reporters/src/utils.ts 80.64% <0.00%> (ø)
packages/jest-reporters/src/verbose_reporter.ts 20.68% <0.00%> (ø)
packages/jest-console/src/BufferedConsole.ts 67.92% <100.00%> (ø)
packages/jest-console/src/CustomConsole.ts 77.55% <100.00%> (ø)
packages/jest-util/src/formatTime.ts 100.00% <100.00%> (ø)
packages/expect/src/utils.ts 96.22% <0.00%> (+1.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa64672...9ebabf5. Read the comment docs.

This commit fixes the formatting of time durations to have a spcae
between the quantity and the unit symbol which is compliant with
the SI. It also consolidates all of the time duration formatting
code into formatTime() in jest-util to keep the code DRY and so
that future updates are easy.
Copy link
Collaborator

@thymikee thymikee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@thymikee thymikee requested review from SimenB and cpojer May 2, 2020 12:06
Copy link
Member

@cpojer cpojer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the attention to detail in this PR a lot. Thank you for improving Jest.

@cpojer cpojer merged commit 71a048e into jestjs:master May 2, 2020
jeysal added a commit to jeysal/jest that referenced this pull request May 2, 2020
…hile-running

* upstream/master: (331 commits)
  chore: update ts-eslint (jestjs#9953)
  Updated config docs with default transform value (jestjs#8583)
  Update jest-phabricator documentation (jestjs#8662)
  chore: remove dependency on `realpath-native` (jestjs#9952)
  chore: bump dated dependencies (jestjs#9951)
  chore: another try at fixing test-utils dependency
  chore: update lockfile due to beta release
  chore: move changelog entry and fix tets utils dependency
  Fix time duration formatting as per SI (jestjs#9765)
  v26.0.0-alpha.0
  chore: run some jsdom tests in leak check (jestjs#9938)
  chore: upgrade chalk to v4 (jestjs#9752)
  feat: upgrade to JSDOM 16 (jestjs#9606)
  chore: remove checks for compileFunction (jestjs#9949)
  chore: drop node 8 support  (jestjs#9423)
  Remove leftover `providesModuleNodeModules` (jestjs#9948)
  [BREAKING] Pojer -> Nakazawa
  chore: revert lockfile changes from 2b32fe6
  chore: move changelog entry and fix lint
  Remove `providesModuleNodeModules` from Jest. (jestjs#9583)
  ...
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants