Skip to content
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

fix: config type in RouteShorthandOptions #5355

Merged

Conversation

BrianValente
Copy link
Contributor

Hello! This PR fixes #5322.

Checklist

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.

Thanks for opening a PR! Can you please add a unit test? We use tsd for types.

@BrianValente BrianValente changed the title Fix config type in RouteShorthandOptions fix: config type in RouteShorthandOptions Mar 21, 2024
@BrianValente BrianValente force-pushed the bugfix/custom-context-config-types branch from 28f8fec to dbfed76 Compare April 16, 2024 13:57
@BrianValente
Copy link
Contributor Author

@mcollina Sorry, but I couldn't find a way to test this. I'm not familiar with tsd, and the kind of test needed here is complex because it should encapsulate a type declaration just for the test.

@BrianValente
Copy link
Contributor Author

@mcollina can you merge it without the tests? I'm relying on patching the library to continue using it. Thanks 🙏

@mcollina
Copy link
Member

Arguably no, I can't. The cost of not including tests is so high long term that "you shall not pass" as Gandalf have said.

@BrianValente BrianValente force-pushed the bugfix/custom-context-config-types branch from c564d55 to f673385 Compare May 13, 2024 19:01
@github-actions github-actions bot added the typescript TypeScript related label May 13, 2024
@BrianValente
Copy link
Contributor Author

You're right! The test is ready, it was a fun challenge! If there's something to improve let me know @mcollina

@BrianValente BrianValente force-pushed the bugfix/custom-context-config-types branch from f673385 to 4af194a Compare May 15, 2024 01:46
@BrianValente
Copy link
Contributor Author

Lint fixed, sorry!

@BrianValente BrianValente force-pushed the bugfix/custom-context-config-types branch from 4af194a to ec19336 Compare May 15, 2024 01:47
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

@mcollina mcollina merged commit 3ff1c54 into fastify:main May 16, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript TypeScript related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conditionals in FastifyRequest based on ContextConfig broken since 4.19.0
3 participants