Skip to content

TypeError Array(...).keys(...).slice is not a function after upgrade from 3.8.3 to 4.4.1 #7098

@Kimserey

Description

@Kimserey

Current behavior:

I am using Cypress on an Angular application.

The following test is working on version 3.8.3

it('cy.get() - query DOM elements', () => {
  let x = [...Array(100).keys()].map(x => x + "");
  cy.server().route('/test', x);
  cy.get('[data-cy=landmark]').invoke('text').should('contain', 'Welcome');
})

but throws an error on 4.4.1

TypeError: Array(...).keys(...).slice is not a function
    at Context.<anonymous> (http://localhost:4200/__cypress/tests?p=cypress/integration/examples/querying.spec.js-628:8:35)

Test code to reproduce

Repository demonstrating the problem: https://github.com/Kimserey/cypress-test-issue

  • branch master is 3.8.3
  • branch upgrade-4 is 4.4.1
  1. From the root directory, run ng serve,
  2. From the root directory, start cypress npx cypress open,
  3. The only test in the integration specs will throw the TypeError.

Versions

Cypress 4.4.1

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