Schedule: Add unit and integration tests to app/dashboard/file-coverage/utils/get-latest-update.ts#803
Open
gitauto-ai[bot] wants to merge 26 commits intomainfrom
Open
Schedule: Add unit and integration tests to app/dashboard/file-coverage/utils/get-latest-update.ts#803gitauto-ai[bot] wants to merge 26 commits intomainfrom
app/dashboard/file-coverage/utils/get-latest-update.ts#803gitauto-ai[bot] wants to merge 26 commits intomainfrom
Conversation
Contributor
Author
|
Pull request completed! 🚀 I autonomously open pull requests on a schedule. You can manage your schedule here. Should you have any questions or wish to change settings or limits, please feel free to contact info@gitauto.ai or invite us to Slack Connect. |
…kip ci] Co-Authored-By: hiroshinishio <hiroshinishio@users.noreply.github.com>
…kip ci] Co-Authored-By: hiroshinishio <hiroshinishio@users.noreply.github.com>
Co-Authored-By: hiroshinishio <hiroshinishio@users.noreply.github.com>
…kip ci] Co-Authored-By: hiroshinishio <hiroshinishio@users.noreply.github.com>
…get-latest-update.test.ts [skip ci] Co-Authored-By: hiroshinishio <hiroshinishio@users.noreply.github.com>
Contributor
Author
|
Created an empty commit to re-trigger the |
Contributor
Author
|
Created an empty commit to re-trigger the |
…tures.test.ts [skip ci]
…res.test.ts with ESLint [skip ci]
Contributor
Author
|
Created an empty commit to re-trigger the |
Contributor
Author
|
Auto-merge blocked: non-test files changed:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current Coverage for app/dashboard/file-coverage/utils/get-latest-update.ts
Instructions
Focus on covering the uncovered areas.
Test these changes locally
What I Tested
I added tests for
getLatestUpdateinget-latest-update.test.ts, covering the reduce logic that finds the maximumupdated_atacross aTables<"coverages">[]array and passes it toformatDateTime. Tests span empty arrays, single items, duplicate dates, large arrays (1000+ items), very old epoch-adjacent dates, and invalid date strings.Potential Bugs Found
"invalid-date") causednew Date(item.updated_at)to produceNaN, which would silently corrupt the reduce comparison and returnnew Date(0)as the "latest" date rather than skipping the bad entry. I fixed the implementation by adding anisNaN(itemDate.getTime())guard inget-latest-update.tsthat skips invalid dates and continues with the currentlatestvalue.Non-Code Tasks
None.
Reviewer note: the sociable test only asserts
typeof result === "string"andresult !== ""rather than checking the actual formatted output. This is intentional sinceformatDateTime's exact output format is not under test here, but it means regressions in the formatted string content would not be caught by this suite.