-
Notifications
You must be signed in to change notification settings - Fork 25
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
chore: Convert to TS - shared context, plan, propTypes, treePaths #3438
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3438 +/- ##
==========================================
- Coverage 99.15% 99.15% -0.01%
==========================================
Files 806 806
Lines 14259 14257 -2
Branches 3946 3939 -7
==========================================
- Hits 14139 14137 -2
Misses 111 111
Partials 9 9
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3438 +/- ##
==========================================
- Coverage 99.15% 99.15% -0.01%
==========================================
Files 806 806
Lines 14259 14257 -2
Branches 3946 3946
==========================================
- Hits 14139 14137 -2
Misses 111 111
Partials 9 9
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #3438 +/- ##
=======================================
Coverage 99.15% 99.15%
=======================================
Files 808 806 -2
Lines 14269 14257 -12
Branches 3942 3946 +4
=======================================
- Hits 14148 14137 -11
+ Misses 112 111 -1
Partials 9 9
... and 5 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. @@ Coverage Diff @@
## main #3438 +/- ##
==========================================
- Coverage 99.15% 99.15% -0.01%
==========================================
Files 806 806
Lines 14259 14257 -2
Branches 3939 3939
==========================================
- Hits 14139 14137 -2
Misses 111 111
Partials 9 9
Continue to review full report in Codecov by Sentry.
|
Bundle ReportChanges will decrease total bundle size by 443 bytes (-0.0%) ⬇️. This is within the configured threshold ✅ Detailed changes
|
@@ -8,7 +8,7 @@ const queryClient = new QueryClient({ | |||
defaultOptions: { queries: { retry: false } }, | |||
}) | |||
|
|||
const wrapper = ({ children }) => ( | |||
const wrapper = ({ children }: { children: React.ReactNode }) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: We usually type this guy out as wrapper: React.FC<React.PropsWithChildren>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah thanks! I followed the wrong pattern - fixed it in other files I saw using the wrong way, too, so others don't mistake that too!
|
||
export function getScheduleStart(scheduledPhase) { | ||
export function getScheduleStart(scheduledPhase: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thoughts on turning this into a shared interface for these two functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I like that - fixed!
import { MemoryRouter, Route } from 'react-router-dom' | ||
|
||
import { useCommitTreePaths } from './useCommitTreePath' | ||
|
||
describe('useCommitTreePaths', () => { | ||
describe('a path is provided', () => { | ||
describe('no duplicate names in path', () => { | ||
const wrapper = ({ children }) => ( | ||
const wrapper = ({ children }: { children: ReactNode }) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment for these as above
function setup({ | ||
repoOverviewData, | ||
}: { | ||
repoOverviewData: typeof overviewMock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would actually be the type of the zod schema right?
const RepositorySchema = z.object({ |
Also if the mock isn't changing, could modify line 81 to just use the mock directly and remove the need to pass it in outright
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah great catch - I meant to come back to fix that one - sloppy. Fixed!
There's one spot passing its own data instead of that general overviewMock
so left the current way and fixed the type
repo, | ||
owner, | ||
}, | ||
{ suspense: false } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this removed on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, useRepoOverview
doesn't take that argument (and can't find where it ever did?) So removing this would be a no-op
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it! Nice fix :)
Bundle ReportChanges will decrease total bundle size by 471 bytes (-0.0%) ⬇️. This is within the configured threshold ✅ Detailed changes
ℹ️ *Bundle size includes cached data from a previous commit |
@@ -18,7 +22,7 @@ const queryClient = new QueryClient({ | |||
|
|||
const wrapper = | |||
(initialEntries = '/gh/owner/coolrepo/tree/main/src%2Ftests') => | |||
({ children }) => ( | |||
({ children }: { children: ReactNode }) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left this one as I thought this notation was a bit clearer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Convert a group of files from JS --> TS
codecov/engineering-team#2745