Back to Nx

Rename Cy Exec Code Property

packages/cypress/src/migrations/update-22-1-0/rename-cy-exec-code-property.md

22.7.1668 B
Original Source

Rename cy.exec().its('code') to cy.exec().its('exitCode')

Cypress v15 renamed the result property exposed by cy.exec() from code to exitCode. This migration updates Cypress spec files managed by Nx so that assertions such as cy.exec(...).its('code') use the new exitCode property.

Read more in the migration guide.

Examples

Before
ts
cy.exec('echo 0').its('code').should('eq', 0);
After
ts
cy.exec('echo 0').its('exitCode').should('eq', 0);