Skip to content

cy.server whitelist behaves as blacklist #6642

@alex-golubtsov

Description

@alex-golubtsov

Current behavior:

Currently whitelist option for cy.server() actually works as blacklist due to this line
https://github.com/cypress-io/cypress/blob/master/packages/driver/src/cypress/server.coffee#L236

In other words:

cy.server({ whitelist: () => true })

will ignore any request

and

cy.server({ whitelist: () => false})

will catch all requests

Desired behavior:

Exactly opposite

cy.server({ whitelist: () => true })

should catch all requests

and

cy.server({ whitelist: () => false})

should ignore any request

Test code to reproduce

cy.server()
cy.route(<any route>)

Versions

4.1.0, also reproducible in master
win10, chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions