Add missing property validationContext on error object#3354
Add missing property validationContext on error object#3354ariesclark wants to merge 3 commits intofastify:mainfrom
Conversation
climba03003
left a comment
There was a problem hiding this comment.
Can you add an unit test for the changes?
It should be added in this folder https://github.com/fastify/fastify/tree/main/test/types
| declare module 'fastify-error' { | ||
| interface FastifyError { | ||
| validation?: ValidationResult[]; | ||
| validationContext?: string; |
There was a problem hiding this comment.
Is it not possible to define the values it can assume?
There was a problem hiding this comment.
I think it's safer to just type as a string instead of a union.
The change is already tested by this line. Also we can add the |
|
If it's already tested there is no need for this change. I think it's a worthwhile change. |
The test should be something like expectType<string | undefined>(error.validationContext)because the test you mention will always pass for any changes in |
There is no check for any other properties in the error object, why should this one be unique? |
Test should be exist to ensure no regression in future. The current test is not enough for this purpose. |
|
@RubyBB Can you fix the missing import for the test? I think it is the last pieces before merge. |
|
Friendly ping @RubyBB Would you like to push this PR over the line? |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Checklist
npm run testandnpm run benchmarkand the Code of conduct