Skip to content

Commit

Permalink
test(types): add tests checking 'validation' and 'validationContext' …
Browse files Browse the repository at this point in the history
…fields of Fa

stifyError type
  • Loading branch information
jakubburzynski committed Oct 20, 2022
1 parent 9b0cb4f commit 9f07a5d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/types/fastify.test-d.ts
Expand Up @@ -10,7 +10,8 @@ import fastify, {
InjectOptions, FastifyBaseLogger,
RouteGenericInterface,
ValidationResult,
FastifyErrorCodes
FastifyErrorCodes,
FastifyError
} from '../../fastify'
import { ErrorObject as AjvErrorObject } from 'ajv'
import * as http from 'http'
Expand Down Expand Up @@ -235,6 +236,9 @@ const ajvErrorObject: AjvErrorObject = {
}
expectAssignable<ValidationResult>(ajvErrorObject)

expectAssignable<FastifyError["validation"]>([ajvErrorObject])
expectAssignable<FastifyError["validationContext"]>("body")

const routeGeneric: RouteGenericInterface = {}
expectType<unknown>(routeGeneric.Body)
expectType<unknown>(routeGeneric.Headers)
Expand Down

0 comments on commit 9f07a5d

Please sign in to comment.