-
-
Notifications
You must be signed in to change notification settings - Fork 83
fix: generify WebsocketRouteOptions #128
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
Conversation
expectType<FastifyRequest<RequestGenericInterface>>(request) | ||
expectType<FastifyRequest<RouteGenericInterface>>(request) | ||
}, | ||
}; |
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.
Want to add a test for the new functionality based on your original issue? Thanks for the contribution!
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 never really tested "types", didn't know that was a thing until now :D
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.
So... what next then? :D
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.
To add a test case you'd need to copy one of these stanzas and exercise specifically the new types you added! I think you could do that by adding a route that uses a specific type for the params or whatever, and then asserting that thats the type of the params you get in the handler. This file is using tsd
which is a typescript testing tool and you can find more info in its docs.
Can this be merged? |
I'm sorry, CI was stuck @fastify/typescript could you take a look? |
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
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.
Ready to go after adding a test!
@VottusCode Do you need any help with this :)? |
|
Merged in #176 |
Checklist
npm run test
andnpm run benchmark
and the Code of conduct
fixes #127