Skip to content

Commit f6e0744

Browse files
breaking: update execa from 1.0.0 to 4.1.0 (#32238)
* breaking: update execa from 1.0.0 to 4.1.0 which breaks the yielded cy.exec() object from yielding property code and instead yields exitCode * fix launchpad tests on linux * Update cli/CHANGELOG.md --------- Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
1 parent 4bb6f7b commit f6e0744

File tree

20 files changed

+57
-67
lines changed

20 files changed

+57
-67
lines changed

.circleci/cache-version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Bump this version to force CI to re-create the cache from scratch.
2-
8-7-2025
2+
8-13-2025

.circleci/workflows.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ mainBuildFilters: &mainBuildFilters
3838
- /^release\/\d+\.\d+\.\d+$/
3939
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
4040
- 'update-v8-snapshot-cache-on-develop'
41-
- 'mabel/issue-10425-studio-redesign'
41+
- 'breaking/update_execa'
4242

4343
# usually we don't build Mac app - it takes a long time
4444
# but sometimes we want to really confirm we are doing the right thing
@@ -49,7 +49,7 @@ macWorkflowFilters: &darwin-workflow-filters
4949
- equal: [ develop, << pipeline.git.branch >> ]
5050
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
5151
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
52-
- equal: [ 'feat/support_vite_7', << pipeline.git.branch >> ]
52+
- equal: [ 'breaking/update_execa', << pipeline.git.branch >> ]
5353
- equal: [ 'chore/test_cypress_recipes_15', << pipeline.git.branch >> ]
5454
- equal: [ 'mabel/issue-31677-reporter-redesign', << pipeline.git.branch >> ]
5555
- matches:
@@ -62,7 +62,7 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters
6262
- equal: [ develop, << pipeline.git.branch >> ]
6363
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
6464
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
65-
- equal: [ 'feat/support_vite_7', << pipeline.git.branch >> ]
65+
- equal: [ 'breaking/update_execa', << pipeline.git.branch >> ]
6666
- matches:
6767
pattern: /^release\/\d+\.\d+\.\d+$/
6868
value: << pipeline.git.branch >>
@@ -85,7 +85,7 @@ windowsWorkflowFilters: &windows-workflow-filters
8585
- equal: [ develop, << pipeline.git.branch >> ]
8686
# use the following branch as well to ensure that v8 snapshot cache updates are fully tested
8787
- equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ]
88-
- equal: [ 'feat/support_vite_7', << pipeline.git.branch >> ]
88+
- equal: [ 'breaking/update_execa', << pipeline.git.branch >> ]
8989
- matches:
9090
pattern: /^release\/\d+\.\d+\.\d+$/
9191
value: << pipeline.git.branch >>
@@ -159,7 +159,7 @@ commands:
159159
name: Set environment variable to determine whether or not to persist artifacts
160160
command: |
161161
echo "Setting SHOULD_PERSIST_ARTIFACTS variable"
162-
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "mabel/issue-10425-studio-redesign" ]]; then
162+
echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "breaking/update_execa" ]]; then
163163
export SHOULD_PERSIST_ARTIFACTS=true
164164
fi' >> "$BASH_ENV"
165165
# You must run `setup_should_persist_artifacts` command and be using bash before running this command

cli/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ _Released 08/12/2025 (PENDING)_
1414
- The application under test's `pagehide` event in Chromium browsers will no longer trigger Cypress's `window:unload` event. Addressed in [#31853](https://github.com/cypress-io/cypress/pull/31853).
1515
- The `Cypress.SelectorPlayground` API has been renamed to `Cypress.ElementSelector`. This API was renamed to accommodate its use for defining `selectorPriority` in Cypress Studio and our future [`cy.prompt` release](https://on.cypress.io/cy-prompt-early-access?utm_source=docs&utm_medium=app-changelog&utm_content=cy-prompt-release). Additionally, the `getSelector` method and the `onElement` option of `defaults` were removed from this API. Addresses [#31801](https://github.com/cypress-io/cypress/issues/31801). Addressed in [#31889](https://github.com/cypress-io/cypress/pull/31889) and [#32098](https://github.com/cypress-io/cypress/pull/32098).
1616
- The direct download option for installing Cypress is no longer supported. Users should install via a package manager. Addressed in [#32249](https://github.com/cypress-io/cypress/pull/32249).
17+
- Updated `execa` from `1.0.0` to `4.1.0`. This changes the `code` property returned by [`cy.exec()`](https://docs.cypress.io/api/commands/exec) to `exitCode`. Addressed in [#32238](https://github.com/cypress-io/cypress/pull/32238).
1718
- **Component Testing breaking changes:**
1819
- Removed support for Angular 17. The minimum supported version is now `18.0.0`. Addresses [#31303](https://github.com/cypress-io/cypress/issues/31303).
1920
- `@cypress/angular` now requires a minimum of `zone.js` `0.14.0`. Addresses [#31582](https://github.com/cypress-io/cypress/issues/31582).

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
"eslint-plugin-react": "7.22.0",
155155
"eslint-plugin-react-hooks": "4.2.0",
156156
"eslint-plugin-vue": "7.18.0",
157-
"execa": "4.0.0",
157+
"execa": "4.1.0",
158158
"fast-xml-parser": "^4.5.1",
159159
"filesize": "10.1.1",
160160
"fs-extra": "9.1.0",

packages/data-context/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"dedent": "^0.7.0",
3737
"ejs": "^3.1.10",
3838
"endent": "2.0.1",
39-
"execa": "1.0.0",
39+
"execa": "4.1.0",
4040
"front-matter": "^4.0.2",
4141
"fs-extra": "8.1.0",
4242
"get-tsconfig": "4.10.0",

packages/driver/cypress/e2e/commands/exec.cy.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const { assertLogLength } = require('../../support/utils')
22
const { _, Promise } = Cypress
33

44
describe('src/cy/commands/exec', () => {
5-
const okResponse = { code: 0 }
5+
const okResponse = { exitCode: 0 }
66

77
context('#exec', {
88
execTimeout: 2500,
@@ -302,7 +302,7 @@ describe('src/cy/commands/exec', () => {
302302

303303
describe('when error code is non-zero', () => {
304304
it('throws error that includes useful information and exit code', (done) => {
305-
Cypress.backend.resolves({ code: 1 })
305+
Cypress.backend.resolves({ exitCode: 1 })
306306

307307
cy.on('fail', (err) => {
308308
expect(err.message).to.contain('`cy.exec(\'ls\')` failed because the command exited with a non-zero code.\n\nPass `{failOnNonZeroExit: false}` to ignore exit code failures.')
@@ -316,7 +316,7 @@ describe('src/cy/commands/exec', () => {
316316
})
317317

318318
it('throws error that includes stderr if it exists and is non-empty', (done) => {
319-
Cypress.backend.resolves({ code: 1, stderr: 'error output', stdout: '' })
319+
Cypress.backend.resolves({ exitCode: 1, stderr: 'error output', stdout: '' })
320320

321321
cy.on('fail', (err) => {
322322
expect(err.message).to.contain('Stderr:\nerror output')
@@ -329,7 +329,7 @@ describe('src/cy/commands/exec', () => {
329329
})
330330

331331
it('throws error that includes stdout if it exists and is non-empty', (done) => {
332-
Cypress.backend.resolves({ code: 1, stderr: '', stdout: 'regular output' })
332+
Cypress.backend.resolves({ exitCode: 1, stderr: '', stdout: 'regular output' })
333333

334334
cy.on('fail', (err) => {
335335
expect(err.message).to.contain('\nStdout:\nregular output')
@@ -342,7 +342,7 @@ describe('src/cy/commands/exec', () => {
342342
})
343343

344344
it('throws error that includes stdout and stderr if they exists and are non-empty', (done) => {
345-
Cypress.backend.resolves({ code: 1, stderr: 'error output', stdout: 'regular output' })
345+
Cypress.backend.resolves({ exitCode: 1, stderr: 'error output', stdout: 'regular output' })
346346

347347
cy.on('fail', (err) => {
348348
expect(err.message).to.contain('\nStdout:\nregular output\nStderr:\nerror output')
@@ -355,7 +355,7 @@ describe('src/cy/commands/exec', () => {
355355

356356
it('truncates the stdout and stderr in the error message', (done) => {
357357
Cypress.backend.resolves({
358-
code: 1,
358+
exitCode: 1,
359359
stderr: `${_.range(200).join()}stderr should be truncated`,
360360
stdout: `${_.range(200).join()}stdout should be truncated`,
361361
})
@@ -381,7 +381,7 @@ describe('src/cy/commands/exec', () => {
381381
expect(Yielded).to.deep.eq({
382382
stdout: 'foo',
383383
stderr: '',
384-
code: 1,
384+
exitCode: 1,
385385
})
386386

387387
done()
@@ -392,7 +392,7 @@ describe('src/cy/commands/exec', () => {
392392

393393
describe('and failOnNonZeroExit is false', () => {
394394
it('does not error', () => {
395-
const response = { code: 1, stderr: 'error output', stdout: 'regular output' }
395+
const response = { exitCode: 1, stderr: 'error output', stdout: 'regular output' }
396396

397397
Cypress.backend.resolves(response)
398398

packages/driver/cypress/e2e/e2e/origin/commands/misc.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ context('cy.origin misc', { browser: '!webkit' }, () => {
9393
expect(consoleProps.name).to.equal('exec')
9494
expect(consoleProps.type).to.equal('command')
9595
expect(consoleProps.props['Shell Used']).to.be.undefined
96-
expect(consoleProps.props.Yielded).to.have.property('code').that.equals(0)
96+
expect(consoleProps.props.Yielded).to.have.property('exitCode').that.equals(0)
9797
expect(consoleProps.props.Yielded).to.have.property('stderr').that.equals('')
9898
expect(consoleProps.props.Yielded).to.have.property('stdout').that.equals('foobar')
9999
})

packages/driver/src/cy/commands/exec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default (Commands, Cypress, cy) => {
6363
consoleOutput['Shell Used'] = result.shell
6464
}
6565

66-
if ((result.code === 0) || !options.failOnNonZeroExit) {
66+
if ((result.exitCode === 0) || !options.failOnNonZeroExit) {
6767
return result
6868
}
6969

@@ -79,7 +79,7 @@ export default (Commands, Cypress, cy) => {
7979

8080
return $errUtils.throwErrByPath('exec.non_zero_exit', {
8181
onFail: options._log,
82-
args: { cmd, output, code: result.code },
82+
args: { cmd, output, code: result.exitCode },
8383
})
8484
})
8585
.catch(Promise.TimeoutError, { timedOut: true }, () => {

packages/example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"test-unit": "echo 'no unit tests'"
1515
},
1616
"devDependencies": {
17-
"cypress-example-kitchensink": "5.0.0",
17+
"cypress-example-kitchensink": "5.1.0",
1818
"gh-pages": "5.0.0",
1919
"gulp": "4.0.2",
2020
"gulp-clean": "0.4.0",

packages/frontend-shared/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"cypress-real-events": "1.14.0",
7575
"dayjs": "^1.9.3",
7676
"dedent": "^0.7.0",
77-
"execa": "4.0.0",
77+
"execa": "4.1.0",
7878
"fake-uuid": "^1.0.0",
7979
"floating-vue": "2.0.0-beta.17",
8080
"fs-extra": "9.1.0",

0 commit comments

Comments
 (0)