Skip to content

Conversation

VottusCode
Copy link
Contributor

Checklist

fixes #127

expectType<FastifyRequest<RequestGenericInterface>>(request)
expectType<FastifyRequest<RouteGenericInterface>>(request)
},
};
Copy link
Member

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!

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Member

@airhorns airhorns May 31, 2021

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.

@VottusCode
Copy link
Contributor Author

Can this be merged?

@mcollina
Copy link
Member

I'm sorry, CI was stuck @fastify/typescript could you take a look?

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@airhorns airhorns left a 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!

@kibertoad
Copy link
Member

@VottusCode Do you need any help with this :)?

@VottusCode
Copy link
Contributor Author

@VottusCode Do you need any help with this :)?
@kibertoad I haven't had time at all due to work combined with other IRL stuff, I will take a look at it.

@airhorns airhorns mentioned this pull request Feb 27, 2022
4 tasks
@airhorns
Copy link
Member

Merged in #176

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Types: WebsocketRouteOptions is not generic and results in handler not being typed properly

5 participants