Skip to content

tests: typing tests fail #255

@Uzlopak

Description

@Uzlopak

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions