From 143904b8e3d50e33f66b84c393514353e971a8af Mon Sep 17 00:00:00 2001 From: Bill Glesias Date: Wed, 13 Aug 2025 13:10:10 -0400 Subject: [PATCH 1/4] chore: update code to exitCode --- docs/api/commands/exec.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/api/commands/exec.mdx b/docs/api/commands/exec.mdx index a1ecf80538..ad78d42e27 100644 --- a/docs/api/commands/exec.mdx +++ b/docs/api/commands/exec.mdx @@ -57,7 +57,7 @@ Pass in an options object to change the default behavior of `cy.exec()`. `cy.exec()` yields an object with the following properties: -- `code` +- `exitCode` - `stdout` - `stderr` @@ -80,7 +80,7 @@ is great for: cy.exec('npm run build').then((result) => { // yields the 'result' object // { - // code: 0, + // exitCode: 0, // stdout: "Files successfully built", // stderr: "" // } @@ -90,7 +90,7 @@ cy.exec('npm run build').then((result) => { #### Seed the database and assert it was successful ```javascript -cy.exec('rake db:seed').its('code').should('eq', 0) +cy.exec('rake db:seed').its('exitCode').should('eq', 0) ``` #### Run an arbitrary script and assert its output @@ -133,7 +133,7 @@ cy.exec('npm run build', { timeout: 20000 }) ```javascript cy.exec('man bear pig', { failOnNonZeroExit: false }).then((result) => { - expect(result.code).to.eq(1) + expect(result.exitCode).to.eq(1) expect(result.stderr).to.contain('No manual entry for bear') }) ``` From 03f3a30de4d324a30d3e5531e1d69ba7f2125e20 Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Fri, 15 Aug 2025 10:33:32 -0400 Subject: [PATCH 2/4] add history to exec --- docs/api/commands/exec.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/api/commands/exec.mdx b/docs/api/commands/exec.mdx index ad78d42e27..7c46fdc9d7 100644 --- a/docs/api/commands/exec.mdx +++ b/docs/api/commands/exec.mdx @@ -237,6 +237,12 @@ the following: alt="console.log exec" /> +## History + +| Version | Changes | +| ------------------------------------------ | ------------------------------------- | +| [15.0.0](/app/references/changelog#15-0-0) | Renamed property `code` to `exitCode` | + ## See also - [`cy.readFile()`](/api/commands/readfile) From 2be3d1c6cfd6ef91a55500b093e48c15b545fd5e Mon Sep 17 00:00:00 2001 From: Jennifer Shehane Date: Fri, 15 Aug 2025 10:37:38 -0400 Subject: [PATCH 3/4] Add short migration descriptions --- docs/app/references/migration-guide.mdx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/app/references/migration-guide.mdx b/docs/app/references/migration-guide.mdx index c4751e9dc9..1dca022f4d 100644 --- a/docs/app/references/migration-guide.mdx +++ b/docs/app/references/migration-guide.mdx @@ -20,6 +20,22 @@ Cypress requires [Node.js](https://nodejs.org/en) in order to install the Cypres Node.js versions 18 and 23 are no longer supported. [See Node's release schedule](https://github.com/nodejs/Release). +### cy.exec code property renamed + +The `code` property on [`cy.exec()`](/api/commands/exec) has been renamed to `exitCode`. + +Before{' '} + +```javascript +cy.exec('rake db:seed').its('code').should('eq', 0) +``` + +After + +```javascript +cy.exec('rake db:seed').its('exitCode').should('eq', 0) +``` + ### Unsupported Linux Distributions Prebuilt binaries for Linux are no longer compatible with Linux distributions based on glibc `<2.31`. From 0d9a2de0481ff4618b20117eda2bd5d9bdbe02dc Mon Sep 17 00:00:00 2001 From: Bill Glesias Date: Fri, 15 Aug 2025 12:56:20 -0400 Subject: [PATCH 4/4] chore: fix linter issues --- docs/app/references/changelog.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/app/references/changelog.mdx b/docs/app/references/changelog.mdx index 9392c1a03e..46890187b3 100644 --- a/docs/app/references/changelog.mdx +++ b/docs/app/references/changelog.mdx @@ -12,7 +12,6 @@ sidebar_label: Changelog _Released 7/29/2025 (PENDING)_ - ## 14.5.4 _Released 8/07/2025_