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

test(testing): improve FakeTime testing #5123

Merged
merged 3 commits into from
Jun 25, 2024

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented Jun 24, 2024

This PR improves test line coverage of testing/time.ts from 85.22% to 93.08% (The missed lines are reduced from 57 to 22)

part of #3713

Copy link

codecov bot commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.78%. Comparing base (ed86fa9) to head (38d085a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5123      +/-   ##
==========================================
+ Coverage   92.74%   92.78%   +0.04%     
==========================================
  Files         480      480              
  Lines       38337    38337              
  Branches     5396     5400       +4     
==========================================
+ Hits        35555    35572      +17     
+ Misses       2726     2710      -16     
+ Partials       56       55       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

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

Great work! Some nits. This also makes me realize we can improve the error types and messages thrown in @std/testing/time. However, that's best handled in a follow-up PR.

testing/time_test.ts Outdated Show resolved Hide resolved
testing/time_test.ts Outdated Show resolved Hide resolved
testing/time_test.ts Show resolved Hide resolved
() => {
time.now = 999;
},
Error,
Copy link
Contributor

Choose a reason for hiding this comment

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

Not for this PR, but we should throw RangeError.

@kt3k kt3k merged commit 40bf2a5 into denoland:main Jun 25, 2024
15 checks passed
@kt3k kt3k deleted the improve-fake-time-testing branch June 25, 2024 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants