Skip to content

.its command with compound properties failing TypeScript check #6431

Closed
@bahmutov

Description

@bahmutov

Cypress v3, v4

Our typescript definition for cy.its command "understands" the properties of the subject, thus it can do

cy.wrap({ foo: 1 }).its('foo') // yup, subject has property "foo"

but it does not understand nested (compound) properties that Lodash _.get can do and we use under the hood

cy.wrap({
  foo: {
    bar: 1
  }
}).its('foo.bar') // oops, TypeScript freaks out, "foo.bar" is invalid

Maybe someone can look at Lodash and its TypeScript definition for _.get to see if they have solved this problem and bring the solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersstage: ready for workThe issue is reproducible and in scopetype: 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