Skip to content

Commit

Permalink
Use Sobek for Geolocation transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
inancgumus committed Nov 5, 2024
1 parent e384842 commit baed93e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions browser/browser_context_mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ func mapBrowserContext(vu moduleVU, bc *common.BrowserContext) mapping { //nolin
"setDefaultNavigationTimeout": bc.SetDefaultNavigationTimeout,
"setDefaultTimeout": bc.SetDefaultTimeout,
"setGeolocation": func(geolocation sobek.Value) (*sobek.Promise, error) {
gl := common.NewGeolocation()
if err := gl.Parse(vu.Context(), geolocation); err != nil {
gl, err := exportTo[common.Geolocation](vu.Runtime(), geolocation)

Check failure on line 90 in browser/browser_context_mapping.go

View workflow job for this annotation

GitHub Actions / lint

vu.Runtime undefined (type moduleVU has no field or method Runtime) (typecheck)
if err != nil {
return nil, fmt.Errorf("parsing geo location: %w", err)
}
return k6ext.Promise(vu.Context(), func() (any, error) {
return nil, bc.SetGeolocation(gl)
return nil, bc.SetGeolocation(&gl)
}), nil
},
"setHTTPCredentials": func(httpCredentials sobek.Value) (*sobek.Promise, error) {
Expand Down

0 comments on commit baed93e

Please sign in to comment.