@@ -25,7 +25,7 @@ describe('cypress', function () {
25
25
}
26
26
27
27
it ( 'calls open#start, passing in options' , function ( ) {
28
- cypress . open ( { foo : 'foo' } )
28
+ return cypress . open ( { foo : 'foo' } )
29
29
. then ( getStartArgs )
30
30
. then ( ( args ) => {
31
31
expect ( args . foo ) . to . equal ( 'foo' )
@@ -37,9 +37,12 @@ describe('cypress', function () {
37
37
pageLoadTime : 10000 ,
38
38
watchForFileChanges : false ,
39
39
}
40
- cypress . open ( { config } )
40
+
41
+ return cypress . open ( { config } )
41
42
. then ( getStartArgs )
42
- . then ( snapshot )
43
+ . then ( ( args ) => {
44
+ expect ( args ) . to . deep . eq ( { config : JSON . stringify ( config ) } )
45
+ } )
43
46
} )
44
47
} )
45
48
@@ -66,44 +69,45 @@ describe('cypress', function () {
66
69
return normalizeCallArgs ( getCallArgs ( run . start ) )
67
70
}
68
71
69
- it ( 'calls run#start, passing in options' , ( ) =>
70
- cypress . run ( { foo : 'foo' } )
72
+ it ( 'calls run#start, passing in options' , ( ) => {
73
+ return cypress . run ( { spec : 'foo' } )
71
74
. then ( getStartArgs )
72
75
. then ( ( args ) => {
73
- expect ( args . foo ) . to . equal ( 'foo' )
76
+ expect ( args . spec ) . to . equal ( 'foo' )
74
77
} )
75
- )
78
+ } )
76
79
77
80
it ( 'normalizes config object' , ( ) => {
78
81
const config = {
79
82
pageLoadTime : 10000 ,
80
83
watchForFileChanges : false ,
81
84
}
85
+
82
86
return cypress . run ( { config } )
83
87
. then ( getStartArgs )
84
- . then ( snapshot )
88
+ . then ( ( args ) => {
89
+ expect ( args ) . to . deep . eq ( { config : JSON . stringify ( config ) } )
90
+ } )
85
91
} )
86
92
87
- it ( 'normalizes env option if passed an object' , ( ) =>
88
- cypress . run ( { env : { foo : 'bar' } } )
89
- . then ( getStartArgs )
90
- . then ( snapshot )
91
- )
93
+ it ( 'normalizes env option if passed an object' , ( ) => {
94
+ const env = { foo : 'bar' , another : 'one' }
92
95
93
- it ( 'normalizes env option if passed an object with multiple properties' , ( ) =>
94
- cypress . run ( { env : { foo : 'bar' , another : 'one' } } )
96
+ return cypress . run ( { env } )
95
97
. then ( getStartArgs )
96
- . then ( snapshot )
97
- )
98
+ . then ( ( args ) => {
99
+ expect ( args ) . to . deep . eq ( { env : JSON . stringify ( env ) } )
100
+ } )
101
+ } )
98
102
99
103
it ( 'gets random tmp file and passes it to run#start' , function ( ) {
100
104
return cypress . run ( ) . then ( ( ) => {
101
105
expect ( run . start . lastCall . args [ 0 ] . outputPath ) . to . equal ( outputPath )
102
106
} )
103
107
} )
104
108
105
- it ( 'resolves with contents of tmp file' , ( ) =>
106
- cypress . run ( ) . then ( snapshot )
107
- )
109
+ it ( 'resolves with contents of tmp file' , ( ) => {
110
+ return cypress . run ( ) . then ( snapshot )
111
+ } )
108
112
} )
109
113
} )
0 commit comments