-
Notifications
You must be signed in to change notification settings - Fork 47
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
types: export FastifyHelmetOptions to TypeScript users #165
Conversation
Pull Request Test Coverage Report for Build 1672290443
💛 - Coveralls |
Pull Request Test Coverage Report for Build 1671986596
💛 - Coveralls |
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.
Thank you for your contribution ^_^
Can you please add a test inside the index.test-d.ts
file ?
@darkgl0w Something like the following make sense as a test to prove that expectType<FastifyPluginCallback<FastifyHelmetOptions> & {
contentSecurityPolicy: typeof helmet.contentSecurityPolicy;
}>(fastifyHelmet); |
Yes something like this should be enough. Seen that we export const helmetOptions = {
contentSecurityPolicy: false,
dnsPrefetchControl: false,
expectCt: false,
frameguard: false,
hidePoweredBy: false,
hsts: false,
ieNoOpen: false,
noSniff: false,
permittedCrossDomainPolicies: false,
referrerPolicy: false,
xssFilter: false
}
// or maybe: expectAssignable<FastifyHelmetOptions>(helmetOptions);
expectType<FastifyHelmetOptions>(helmetOptions); |
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.
Can you please add a unit test?
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
Checklist
npm run test
andnpm run benchmark
and the Code of conduct