Skip to content

Suggestion: TypeScript: remove fallback for should to increase type safety #5573

@OliverJAsh

Description

@OliverJAsh

Current behavior:

cy.get('foo').should('whatevergoeshere'); // no error :-(

cy.get('foo').should('exis'); // oops, typo—but no error :-(
cy.get('foo').should('exist'); // ✅

Desired behavior:

cy.get('foo').should('whatevergoeshere'); // type error, `whatevergoeshere` is not a valid assertion

cy.get('foo').should('exis'); // type error, `exis` is not a valid assertion
cy.get('foo').should('exist'); // ✅

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: typingsIssue related to Cypress types (for TypeScript)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions