@@ -57,7 +57,7 @@ Pass in an options object to change the default behavior of `cy.exec()`.
5757
5858` cy.exec() ` yields an object with the following properties:
5959
60- - ` code `
60+ - ` exitCode `
6161- ` stdout `
6262- ` stderr `
6363
@@ -80,7 +80,7 @@ is great for:
8080cy .exec (' npm run build' ).then ((result ) => {
8181 // yields the 'result' object
8282 // {
83- // code : 0,
83+ // exitCode : 0,
8484 // stdout: "Files successfully built",
8585 // stderr: ""
8686 // }
@@ -90,7 +90,7 @@ cy.exec('npm run build').then((result) => {
9090#### Seed the database and assert it was successful
9191
9292``` javascript
93- cy .exec (' rake db:seed' ).its (' code ' ).should (' eq' , 0 )
93+ cy .exec (' rake db:seed' ).its (' exitCode ' ).should (' eq' , 0 )
9494```
9595
9696#### Run an arbitrary script and assert its output
@@ -133,7 +133,7 @@ cy.exec('npm run build', { timeout: 20000 })
133133
134134``` javascript
135135cy .exec (' man bear pig' , { failOnNonZeroExit: false }).then ((result ) => {
136- expect (result .code ).to .eq (1 )
136+ expect (result .exitCode ).to .eq (1 )
137137 expect (result .stderr ).to .contain (' No manual entry for bear' )
138138})
139139```
@@ -237,6 +237,12 @@ the following:
237237 alt = " console.log exec"
238238/>
239239
240+ ## History
241+
242+ | Version | Changes |
243+ | ------------------------------------------ | ------------------------------------- |
244+ | [ 15.0.0] ( /app/references/changelog#15-0-0 ) | Renamed property ` code ` to ` exitCode ` |
245+
240246## See also
241247
242248- [ ` cy.readFile() ` ] ( /api/commands/readfile )
0 commit comments