which version of @testing-library/cypress is compatible with cypress version 9.5.3?

369 views Asked by At

I am trying to install @testing-library/cypress with [email protected] already installed in my project.

It gives me a could not resolve dependency error. It expects cypress@^12.0.0

I cannot update the cypress dependency. How do I find the right @testing-library/cypress version for [email protected] ?

1

There are 1 answers

0
Katherine Johnson On BEST ANSWER

v8.0.7 says the following in package.json:

"peerDependencies": {
  "cypress": "^2.1.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0"
},

And it works with a simple test:

import '@testing-library/cypress/add-commands'

it('uses testing library to find heading', () => {
  cy.visit('http://example.com');
  cy.findByRole('heading')
    .should('have.text', 'Example Domain')
})

The next version is v9.0.0 which shows peer dependency of [email protected], and crashes when used with [email protected]