Skip to content

Missing socket #87

@Eomm

Description

@Eomm

Hi,
I'm writing some test for a Fastify plugin that uses some koa handler to manage routes.

The test is failing due this check of koa lib:

if (this.socket.encrypted) return 'https';

https://github.com/koajs/koa/blob/master/lib/request.js#L402

Considered that:

  • the final solution would be to implement a native plugin for Fastify
  • light my request says "Does not use a socket connection.."
  • I can use listen instead of inject to write my tests

Do you think adding a this.socket = {} to the light-my-request is a bad idea?
How would you cover this use case?

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