Skip to content

Commit

Permalink
Update the mapping to work with remoteRegistry
Browse files Browse the repository at this point in the history
Now that the remoteRegistry is part of the ModuleInstance, we can
retrieve the parsed data from the env var and use it when setting up
the mapping for the current vu.
  • Loading branch information
ankur22 committed May 17, 2023
1 parent c99ca27 commit 63196d0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions browser/mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
"os"

"github.com/dop251/goja"

Expand Down Expand Up @@ -36,7 +35,7 @@ func mapBrowserToGoja(vu moduleVU) *goja.Object {
obj = rt.NewObject()
// TODO: Use k6 LookupEnv instead of OS package methods.
// See https://github.com/grafana/xk6-browser/issues/822.
wsURL, isRemoteBrowser = IsRemoteBrowser(os.LookupEnv)
wsURL, isRemoteBrowser = vu.remoteRegistry.IsRemoteBrowser()
browserType = chromium.NewBrowserType(vu)
)
for k, v := range mapBrowserType(vu, browserType, wsURL, isRemoteBrowser) {
Expand Down

0 comments on commit 63196d0

Please sign in to comment.