Skip to content

Commit

Permalink
Rename back to browser
Browse files Browse the repository at this point in the history
k6 depends on the import to be browser and not module.
  • Loading branch information
ankur22 committed May 23, 2023
1 parent e1a563e commit 619acc0
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion module/mapping.go → browser/mapping.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package module
package browser

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion module/mapping_test.go → browser/mapping_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package module
package browser

import (
"reflect"
Expand Down
4 changes: 2 additions & 2 deletions module/module.go → browser/module.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package module provides an entry point to the browser module.
package module
// Package browser provides an entry point to the browser module.
package browser

import (
"os"
Expand Down
2 changes: 1 addition & 1 deletion module/module_test.go → browser/module_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package module
package browser

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion module/modulevu.go → browser/modulevu.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package module
package browser

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion module/registry.go → browser/registry.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package module
package browser

import (
"crypto/rand"
Expand Down
2 changes: 1 addition & 1 deletion module/registry_test.go → browser/registry_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package module
package browser

import (
"sync"
Expand Down
4 changes: 2 additions & 2 deletions register.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
_ "net/http/pprof" //nolint:gosec
"os"

"github.com/grafana/xk6-browser/module"
"github.com/grafana/xk6-browser/browser"

k6modules "go.k6.io/k6/js/modules"
)
Expand All @@ -24,5 +24,5 @@ func init() {
}

func init() {
k6modules.Register("k6/x/browser", module.New())
k6modules.Register("k6/x/browser", browser.New())
}
6 changes: 3 additions & 3 deletions tests/browser_type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (

"github.com/stretchr/testify/require"

"github.com/grafana/xk6-browser/browser"
"github.com/grafana/xk6-browser/chromium"
"github.com/grafana/xk6-browser/k6ext/k6test"
"github.com/grafana/xk6-browser/module"
)

func TestBrowserTypeConnect(t *testing.T) {
Expand Down Expand Up @@ -35,9 +35,9 @@ func TestBrowserTypeLaunchToConnect(t *testing.T) {
// to take mapping layer into account, instead of calling
// BrowserType.Launch method directly
rt := vu.Runtime()
root := module.New()
root := browser.New()
mod := root.NewModuleInstance(vu)
jsMod, ok := mod.Exports().Default.(*module.JSModule)
jsMod, ok := mod.Exports().Default.(*browser.JSModule)
require.Truef(t, ok, "unexpected default mod export type %T", mod.Exports().Default)

vu.MoveToVUContext()
Expand Down

0 comments on commit 619acc0

Please sign in to comment.