File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
cypress/e2e/2-advanced-examples Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,8 @@ <h4 id="exec"><a href="https://on.cypress.io/exec">cy.exec()</a></h4>
129129 .its('stderr').should('be.empty')
130130
131131 cy.exec('pwd')
132- .its('code').should('eq', 0)
132+ // for Cypress 14 and below, use 'code' instead of 'exitCode'
133+ .its('exitCode').should('eq', 0)
133134}</ code > </ pre >
134135 </ div >
135136
Original file line number Diff line number Diff line change @@ -48,8 +48,15 @@ context('Misc', () => {
4848 cy . exec ( `cat ${ Cypress . config ( 'configFile' ) } ` )
4949 . its ( 'stderr' ) . should ( 'be.empty' )
5050
51- cy . exec ( 'pwd' )
52- . its ( 'code' ) . should ( 'eq' , 0 )
51+ cy . log ( `Cypress version ${ Cypress . version } ` )
52+ if ( Cypress . version . split ( '.' ) . map ( Number ) [ 0 ] < 15 ) {
53+ cy . exec ( 'pwd' )
54+ . its ( 'code' ) . should ( 'eq' , 0 )
55+ }
56+ else {
57+ cy . exec ( 'pwd' )
58+ . its ( 'exitCode' ) . should ( 'eq' , 0 )
59+ }
5360 }
5461 } )
5562
You can’t perform that action at this time.
0 commit comments