-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Tests] Amend typos and extraneous <Set />
generic typings in router tests
#11894
base: main
Are you sure you want to change the base?
Conversation
<Set />
typings<Set />
typings
@Tobbe i'm afraid you're not going to like this (packages/router/src/tests/router.test.tsx): #11739 was still fine – it's also what i would love to see in the next v8 patch release as it fixes what broke during the migration from 7 → 8. Starting with #11756 the typing all went downhill 🙈
Not sure if this is easily fixable or if we maybe should revert starting from #11756 for the time being and try another day. Just wanted to quickly share this as a heads up. |
Arrrg! Router typings! What a mess 🤬 Why is this to difficult to get right 😰 I'm down to revert if we think that's the best way forward |
I just double-checked – everything after #11739 (which is OK) adds 8 red squiggles to … in that order of revert should work.
Something about
Well, at least we have a document of our joint failure in the git history now 🤣 – we can always start over from there. Then we would at least be sure typings can only get better and never get worse / broken again 😎 |
<Set />
typings<Set />
generic typings
<Set />
generic typings<Set />
generic typings in router tests
@@ -653,7 +653,7 @@ test('Nested sets, and authentication logic', () => { | |||
}) | |||
}) | |||
|
|||
test('Give correct ids to root sets', () => { | |||
test('gives correct ids to root sets', () => { |
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.
I actually think this was better the way it was.
Had this been an it
-test instead I would have agreed with your change. But with test
I think "test: Give correct..." reads better
(But I really wish all tests used it()
)
@@ -925,11 +925,7 @@ test('Private is an alias for Set private', async () => { | |||
const TestRouter = () => ( | |||
<Router useAuth={mockUseAuth({ isAuthenticated: true })}> | |||
<Route path="/" page={HomePage} name="home" /> | |||
<Private<PrivateLayoutProps> |
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.
With all the type change PRs reverted I think I want to keep this as it was. What's your thought on that, @Philzen?
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.
At the end of the day, these are completely redundant – there is no more or less TS errors in these files with or without them.
But let me double check if it changes anything regarding auto-completion – although even then, they would be just noise in the test, as they don't serve any purpose concerning stuff that would be able to come up in a CI.
My thought is to find a use case where they are actually required and implement a test for that, whilst removing those generics where they aren't.
Just a handful of test name and typescript amendments – discovered while skimming over https://github.com/redwoodjs/redwood/pull/10464/files