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 exception for missing units in Duration.round() #1264

Merged
merged 4 commits into from Jan 13, 2021

Conversation

ptomato
Copy link
Collaborator

@ptomato ptomato commented Jan 12, 2021

Closes: #1255

This is the same as what the other round() methods already do.

See: #1255
If neither 'largestUnit' nor 'smallestUnit' is present in the options
object, throw a RangeError.

Closes: #1255
This is in order to match the spec text.
@codecov
Copy link

codecov bot commented Jan 12, 2021

Codecov Report

Merging #1264 (7131a35) into main (5930868) will increase coverage by 2.48%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1264      +/-   ##
==========================================
+ Coverage   93.55%   96.04%   +2.48%     
==========================================
  Files          19       19              
  Lines        7961     9306    +1345     
  Branches     1264     1415     +151     
==========================================
+ Hits         7448     8938    +1490     
+ Misses        506      362     -144     
+ Partials        7        6       -1     
Flag Coverage Δ
test262 56.24% <ø> (+14.64%) ⬆️
tests 92.19% <ø> (+2.75%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
polyfill/lib/legacydate.mjs
polyfill/lib/shim.mjs
polyfill/lib/intrinsicclass.mjs
polyfill/lib/slots.mjs
lib/plaindate.mjs 93.31% <0.00%> (ø)
lib/duration.mjs 97.86% <0.00%> (ø)
lib/plaindatetime.mjs 95.60% <0.00%> (ø)
lib/intl.mjs 100.00% <0.00%> (ø)
lib/plaintime.mjs 96.68% <0.00%> (ø)
lib/regex.mjs 100.00% <0.00%> (ø)
... and 13 more

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 2f36d91...94f6a4c. Read the comment docs.

@Ms2ger Ms2ger merged commit d0ed6dd into main Jan 13, 2021
@Ms2ger Ms2ger deleted the 1255-fix-missing-units-duration-round branch January 13, 2021 08:09
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 this pull request may close these issues.

Duration.round() should always throw if neither largestUnit nor smallestUnit are given
2 participants