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

tests: typing tests fail #255

Open
Uzlopak opened this issue Dec 9, 2024 · 2 comments
Open

tests: typing tests fail #255

Uzlopak opened this issue Dec 9, 2024 · 2 comments

Comments

@Uzlopak
Copy link
Contributor

Uzlopak commented Dec 9, 2024

There are some issues with the typings tests.

> fastify-plugin@5.0.1 test:typescript
> tsd


  types/plugin.test-d.ts:99:16
  ✖   99:16  No overload matches this call.
  Overload 1 of 6, (plugin: FastifyPluginCallback<FastifyPluginOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger>): FastifyInstance<...> & ... 1 more ... & { ...; }, gave the following error.
    Argument of type FastifyPluginCallback<Options> is not assignable to parameter of type FastifyPluginCallback<FastifyPluginOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger>.
      Types of parameters opts and opts are incompatible.
        Type FastifyPluginOptions is not assignable to type Options.
  Overload 2 of 6, (plugin: FastifyPluginAsync<FastifyPluginOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger>): FastifyInstance<...> & ... 1 more ... & { ...; }, gave the following error.
    Argument of type FastifyPluginCallback<Options> is not assignable to parameter of type FastifyPluginAsync<FastifyPluginOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger>.
      Target signature provides too few arguments. Expected 3 or more, but got 2.
  Overload 3 of 6, (plugin: FastifyPluginCallback<FastifyPluginOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger> | FastifyPluginAsync<...> | Promise<...> | Promise<...>): FastifyInstance<...> & ... 1 more ... & { ...; }, gave the following error.
    Argument of type FastifyPluginCallback<Options> is not assignable to parameter of type FastifyPluginCallback<FastifyPluginOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger> | FastifyPluginAsync<...> | Promise<...> | Promise<...>.
      Type FastifyPluginCallback<Options> is not assignable to type FastifyPluginCallback<FastifyPluginOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger>.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
  ✖  100:16  No overload matches this call.
  Overload 1 of 6, (plugin: FastifyPluginCallback<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, FastifyTypeProviderDefault, FastifyBaseLogger>): FastifyInstance<...> & ... 1 more ... & { ...; }, gave the following error.
    Argument of type FastifyPluginCallback<Options, Server<typeof IncomingMessage, typeof ServerResponse>> is not assignable to parameter of type FastifyPluginCallback<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, FastifyTypeProviderDefault, FastifyBaseLogger>.
      Types of parameters opts and opts are incompatible.
        Type FastifyPluginOptions is not assignable to type Options.
  Overload 2 of 6, (plugin: FastifyPluginAsync<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, FastifyTypeProviderDefault, FastifyBaseLogger>): FastifyInstance<...> & ... 1 more ... & { ...; }, gave the following error.
    Argument of type FastifyPluginCallback<Options, Server<typeof IncomingMessage, typeof ServerResponse>> is not assignable to parameter of type FastifyPluginAsync<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, FastifyTypeProviderDefault, FastifyBaseLogger>.
      Target signature provides too few arguments. Expected 3 or more, but got 2.
  Overload 3 of 6, (plugin: FastifyPluginCallback<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, FastifyTypeProviderDefault, FastifyBaseLogger> | FastifyPluginAsync<...> | Promise<...> | Promise<...>): FastifyInstance<...> & ... 1 more ... & { ...; }, gave the following error.
    Argument of type FastifyPluginCallback<Options, Server<typeof IncomingMessage, typeof ServerResponse>> is not assignable to parameter of type FastifyPluginCallback<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, FastifyTypeProviderDefault, FastifyBaseLogger> | FastifyPluginAsync<...> | Promise<...> | Promise<...>.
      Type FastifyPluginCallback<Options, Server<typeof IncomingMessage, typeof ServerResponse>> is not assignable to type FastifyPluginCallback<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, FastifyTypeProviderDefault, FastifyBaseLogger>.                                                                  
  ✖  101:16  No overload matches this call.
  Overload 1 of 6, (plugin: FastifyPluginCallback<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider, FastifyBaseLogger>): FastifyInstance<...> & ... 1 more ... & { ...; }, gave the following error.
    Argument of type FastifyPluginCallback<Options, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider> is not assignable to parameter of type FastifyPluginCallback<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider, FastifyBaseLogger>.
      Types of parameters opts and opts are incompatible.
        Type FastifyPluginOptions is not assignable to type Options.
  Overload 2 of 6, (plugin: FastifyPluginAsync<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider, FastifyBaseLogger>): FastifyInstance<...> & ... 1 more ... & { ...; }, gave the following error.
    Argument of type FastifyPluginCallback<Options, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider> is not assignable to parameter of type FastifyPluginAsync<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider, FastifyBaseLogger>.
      Target signature provides too few arguments. Expected 3 or more, but got 2.
  Overload 3 of 6, (plugin: FastifyPluginCallback<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider, FastifyBaseLogger> | FastifyPluginAsync<...> | Promise<...> | Promise<...>): FastifyInstance<...> & ... 1 more ... & { ...; }, gave the following error.
    Argument of type FastifyPluginCallback<Options, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider> is not assignable to parameter of type FastifyPluginCallback<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider, FastifyBaseLogger> | FastifyPluginAsync<...> | Promise<...> | Promise<...>.
      Type FastifyPluginCallback<Options, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider> is not assignable to type FastifyPluginCallback<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider, FastifyBaseLogger>.                               
  ✖  104:16  No overload matches this call.
  Overload 1 of 6, (plugin: FastifyPluginCallback<FastifyPluginOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger>): FastifyInstance<...> & ... 1 more ... & { ...; }, gave the following error.
    Argument of type FastifyPluginAsync<Options> is not assignable to parameter of type FastifyPluginCallback<FastifyPluginOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger>.
      Types of parameters opts and opts are incompatible.
        Type FastifyPluginOptions is not assignable to type Options.
  Overload 2 of 6, (plugin: FastifyPluginAsync<FastifyPluginOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger>): FastifyInstance<...> & ... 1 more ... & { ...; }, gave the following error.
    Argument of type FastifyPluginAsync<Options> is not assignable to parameter of type FastifyPluginAsync<FastifyPluginOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger>.
      Types of parameters opts and opts are incompatible.
        Type FastifyPluginOptions is not assignable to type Options.
  Overload 3 of 6, (plugin: FastifyPluginCallback<FastifyPluginOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger> | FastifyPluginAsync<...> | Promise<...> | Promise<...>): FastifyInstance<...> & ... 1 more ... & { ...; }, gave the following error.
    Argument of type FastifyPluginAsync<Options> is not assignable to parameter of type FastifyPluginCallback<FastifyPluginOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger> | FastifyPluginAsync<...> | Promise<...> | Promise<...>.
      Type FastifyPluginAsync<Options> is not assignable to type FastifyPluginAsync<FastifyPluginOptions, RawServerDefault, FastifyTypeProviderDefault, FastifyBaseLogger>.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
  ✖  105:16  No overload matches this call.
  Overload 1 of 6, (plugin: FastifyPluginCallback<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, FastifyTypeProviderDefault, FastifyBaseLogger>): FastifyInstance<...> & ... 1 more ... & { ...; }, gave the following error.
    Argument of type FastifyPluginAsync<Options, Server<typeof IncomingMessage, typeof ServerResponse>> is not assignable to parameter of type FastifyPluginCallback<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, FastifyTypeProviderDefault, FastifyBaseLogger>.
      Types of parameters opts and opts are incompatible.
        Type FastifyPluginOptions is not assignable to type Options.
  Overload 2 of 6, (plugin: FastifyPluginAsync<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, FastifyTypeProviderDefault, FastifyBaseLogger>): FastifyInstance<...> & ... 1 more ... & { ...; }, gave the following error.
    Argument of type FastifyPluginAsync<Options, Server<typeof IncomingMessage, typeof ServerResponse>> is not assignable to parameter of type FastifyPluginAsync<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, FastifyTypeProviderDefault, FastifyBaseLogger>.
      Types of parameters opts and opts are incompatible.
        Type FastifyPluginOptions is not assignable to type Options.
  Overload 3 of 6, (plugin: FastifyPluginCallback<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, FastifyTypeProviderDefault, FastifyBaseLogger> | FastifyPluginAsync<...> | Promise<...> | Promise<...>): FastifyInstance<...> & ... 1 more ... & { ...; }, gave the following error.
    Argument of type FastifyPluginAsync<Options, Server<typeof IncomingMessage, typeof ServerResponse>> is not assignable to parameter of type FastifyPluginCallback<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, FastifyTypeProviderDefault, FastifyBaseLogger> | FastifyPluginAsync<...> | Promise<...> | Promise<...>.
      Type FastifyPluginAsync<Options, Server<typeof IncomingMessage, typeof ServerResponse>> is not assignable to type FastifyPluginAsync<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, FastifyTypeProviderDefault, FastifyBaseLogger>.                                     
  ✖  106:16  No overload matches this call.
  Overload 1 of 6, (plugin: FastifyPluginCallback<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider, FastifyBaseLogger>): FastifyInstance<...> & ... 1 more ... & { ...; }, gave the following error.
    Argument of type FastifyPluginAsync<Options, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider> is not assignable to parameter of type FastifyPluginCallback<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider, FastifyBaseLogger>.
      Types of parameters opts and opts are incompatible.
        Type FastifyPluginOptions is not assignable to type Options.
  Overload 2 of 6, (plugin: FastifyPluginAsync<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider, FastifyBaseLogger>): FastifyInstance<...> & ... 1 more ... & { ...; }, gave the following error.
    Argument of type FastifyPluginAsync<Options, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider> is not assignable to parameter of type FastifyPluginAsync<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider, FastifyBaseLogger>.
      Types of parameters opts and opts are incompatible.
        Type FastifyPluginOptions is not assignable to type Options.
  Overload 3 of 6, (plugin: FastifyPluginCallback<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider, FastifyBaseLogger> | FastifyPluginAsync<...> | Promise<...> | Promise<...>): FastifyInstance<...> & ... 1 more ... & { ...; }, gave the following error.
    Argument of type FastifyPluginAsync<Options, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider> is not assignable to parameter of type FastifyPluginCallback<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider, FastifyBaseLogger> | FastifyPluginAsync<...> | Promise<...> | Promise<...>.
      Type FastifyPluginAsync<Options, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider> is not assignable to type FastifyPluginAsync<FastifyPluginOptions, Server<typeof IncomingMessage, typeof ServerResponse>, TypeBoxTypeProvider, FastifyBaseLogger>.  

  6 errors
@Uzlopak
Copy link
Contributor Author

Uzlopak commented Dec 9, 2024

Ah, related to
fastify/fastify#5637

@Fdawgs
Copy link
Member

Fdawgs commented Dec 9, 2024

Types or type tests need fixing as mentioned in fastify/session#282 (comment)

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

No branches or pull requests

2 participants