Skip to content

Commit

Permalink
update code again
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-shehane committed Sep 19, 2024
1 parent aa1e166 commit 48a2068
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/driver/cypress/e2e/commands/exec.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { assertLogLength } = require('../../support/utils')
const { _, Promise } = Cypress

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

context('#exec', {
execTimeout: 2500,
Expand Down Expand Up @@ -300,7 +300,7 @@ describe('src/cy/commands/exec', () => {

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

cy.on('fail', (err) => {
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.')
Expand All @@ -314,7 +314,7 @@ describe('src/cy/commands/exec', () => {
})

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

cy.on('fail', (err) => {
expect(err.message).to.contain('Stderr:\nerror output')
Expand All @@ -327,7 +327,7 @@ describe('src/cy/commands/exec', () => {
})

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

cy.on('fail', (err) => {
expect(err.message).to.contain('\nStdout:\nregular output')
Expand All @@ -340,7 +340,7 @@ describe('src/cy/commands/exec', () => {
})

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

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

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

Cypress.backend.resolves(response)

Expand Down

0 comments on commit 48a2068

Please sign in to comment.