Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 79969b3

Browse files
committed
Log when a default launch opt is overridden
1 parent 44a2760 commit 79969b3

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

common/browser_options.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,22 @@ func (l *LaunchOptions) Parse(ctx context.Context, opts goja.Value, logger *log.
5656
return errors.New("LaunchOptions does not exist in the runtime")
5757
}
5858
var (
59-
rt = k6ext.Runtime(ctx)
60-
o = opts.ToObject(rt)
59+
rt = k6ext.Runtime(ctx)
60+
o = opts.ToObject(rt)
61+
defaults = map[string]any{
62+
"env": l.Env,
63+
"headless": l.Headless,
64+
"logCategoryFilter": l.LogCategoryFilter,
65+
"timeout": l.Timeout,
66+
}
6167
)
6268
for _, k := range o.Keys() {
6369
v := o.Get(k)
6470
if v.Export() == nil {
65-
continue // don't override the defaults on `null``
71+
if dv, ok := defaults[k]; ok {
72+
logger.Warnf("LaunchOptions", "%s was null and set to its default: %v", k, dv)
73+
}
74+
continue
6675
}
6776
var err error
6877
switch k {

0 commit comments

Comments
 (0)