This repository was archived by the owner on Jan 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,10 @@ func TestBrowserLaunchOptionsParse(t *testing.T) {
15
15
t .Parallel ()
16
16
17
17
for name , tt := range map [string ]struct {
18
- opts map [string ]any
19
- assert func (testing.TB , * LaunchOptions )
20
- err string
18
+ opts map [string ]any
19
+ assert func (testing.TB , * LaunchOptions )
20
+ err string
21
+ onCloud bool
21
22
}{
22
23
"defaults" : {
23
24
opts : map [string ]any {},
@@ -31,6 +32,24 @@ func TestBrowserLaunchOptionsParse(t *testing.T) {
31
32
}, lo )
32
33
},
33
34
},
35
+ "defaults_on_cloud" : {
36
+ onCloud : true ,
37
+ opts : map [string ]any {
38
+ "headless" : false ,
39
+ "devtools" : true ,
40
+ "executablePath" : "something else" ,
41
+ },
42
+ assert : func (tb testing.TB , lo * LaunchOptions ) {
43
+ tb .Helper ()
44
+ assert .Equal (t , & LaunchOptions {
45
+ Env : make (map [string ]string ),
46
+ Headless : true ,
47
+ LogCategoryFilter : ".*" ,
48
+ Timeout : DefaultTimeout ,
49
+ onCloud : true ,
50
+ }, lo )
51
+ },
52
+ },
34
53
"nulls" : { // don't override the defaults on `null`
35
54
opts : map [string ]any {
36
55
"env" : nil ,
@@ -212,7 +231,7 @@ func TestBrowserLaunchOptionsParse(t *testing.T) {
212
231
t .Parallel ()
213
232
var (
214
233
vu = k6test .NewVU (t )
215
- lo = NewLaunchOptions (false )
234
+ lo = NewLaunchOptions (tt . onCloud )
216
235
)
217
236
err := lo .Parse (vu .Context (), vu .ToGojaValue (tt .opts ), log .NewNullLogger ())
218
237
if tt .err != "" {
You can’t perform that action at this time.
0 commit comments