Skip to content

Are types for ServerOptions.whitelist correct? #5680

@mspoulsen

Description

@mspoulsen

I am using cypress with typescript. I was looking at the ServerOptions type:

interface ServerOptions {
    delay: number
    method: HttpMethod
    status: number
    headers: object
    response: any
    onRequest(...args: any[]): void
    onResponse(...args: any[]): void
    onAbort(...args: any[]): void
    enable: boolean
    force404: boolean
    urlMatchingOptions: object
    whitelist(xhr: Request): void
    onAnyRequest(route: RouteOptions, proxy: any): void
    onAnyResponse(route: RouteOptions, proxy: any): void
    onAnyAbort(route: RouteOptions, proxy: any): void
  }

More specifically:

whitelist(xhr: Request): void

Is this type correct? I would expect this type to be:

whitelist(xhr: XMLHttpRequest): void

The xhr passed to the callback certainly behaves like an XMLHttpRequest.

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