@@ -57,7 +57,7 @@ Pass in an options object to change the default behavior of `cy.exec()`.
57
57
58
58
` cy.exec() ` yields an object with the following properties:
59
59
60
- - ` code `
60
+ - ` exitCode `
61
61
- ` stdout `
62
62
- ` stderr `
63
63
@@ -80,7 +80,7 @@ is great for:
80
80
cy .exec (' npm run build' ).then ((result ) => {
81
81
// yields the 'result' object
82
82
// {
83
- // code : 0,
83
+ // exitCode : 0,
84
84
// stdout: "Files successfully built",
85
85
// stderr: ""
86
86
// }
@@ -90,7 +90,7 @@ cy.exec('npm run build').then((result) => {
90
90
#### Seed the database and assert it was successful
91
91
92
92
``` javascript
93
- cy .exec (' rake db:seed' ).its (' code ' ).should (' eq' , 0 )
93
+ cy .exec (' rake db:seed' ).its (' exitCode ' ).should (' eq' , 0 )
94
94
```
95
95
96
96
#### Run an arbitrary script and assert its output
@@ -133,7 +133,7 @@ cy.exec('npm run build', { timeout: 20000 })
133
133
134
134
``` javascript
135
135
cy .exec (' man bear pig' , { failOnNonZeroExit: false }).then ((result ) => {
136
- expect (result .code ).to .eq (1 )
136
+ expect (result .exitCode ).to .eq (1 )
137
137
expect (result .stderr ).to .contain (' No manual entry for bear' )
138
138
})
139
139
```
@@ -237,6 +237,12 @@ the following:
237
237
alt = " console.log exec"
238
238
/>
239
239
240
+ ## History
241
+
242
+ | Version | Changes |
243
+ | ------------------------------------------ | ------------------------------------- |
244
+ | [ 15.0.0] ( /app/references/changelog#15-0-0 ) | Renamed property ` code ` to ` exitCode ` |
245
+
240
246
## See also
241
247
242
248
- [ ` cy.readFile() ` ] ( /api/commands/readfile )
0 commit comments