Skip to content

Commit

Permalink
Rename back to ModuleInstance
Browse files Browse the repository at this point in the history
This no longer stutters.
  • Loading branch information
ankur22 committed May 23, 2023
1 parent 75f5d90 commit e8b4d6e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions browser/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ type (
Version string
}

// JSModuleInstance represents an instance of the JS module.
JSModuleInstance struct {
// ModuleInstance represents an instance of the JS module.
ModuleInstance struct {
mod *JSModule
}
)

var (
_ k6modules.Module = &RootModule{}
_ k6modules.Instance = &JSModuleInstance{}
_ k6modules.Instance = &ModuleInstance{}
)

// New returns a pointer to a new RootModule instance.
Expand All @@ -48,7 +48,7 @@ func New() *RootModule {
// NewModuleInstance implements the k6modules.Module interface to return
// a new instance for each VU.
func (m *RootModule) NewModuleInstance(vu k6modules.VU) k6modules.Instance {
return &JSModuleInstance{
return &ModuleInstance{
mod: &JSModule{
Chromium: mapBrowserToGoja(moduleVU{
VU: vu,
Expand All @@ -62,6 +62,6 @@ func (m *RootModule) NewModuleInstance(vu k6modules.VU) k6modules.Instance {

// Exports returns the exports of the JS module so that it can be used in test
// scripts.
func (mi *JSModuleInstance) Exports() k6modules.Exports {
func (mi *ModuleInstance) Exports() k6modules.Exports {
return k6modules.Exports{Default: mi.mod}
}
2 changes: 1 addition & 1 deletion browser/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestModuleNew(t *testing.T) {
},
CtxField: context.Background(),
}
m, ok := New().NewModuleInstance(vu).(*JSModuleInstance)
m, ok := New().NewModuleInstance(vu).(*ModuleInstance)
require.True(t, ok, "NewModuleInstance should return a ModuleInstance")
require.NotNil(t, m.mod, "Module should be set")
require.NotNil(t, m.mod.Chromium, "Chromium should be set")
Expand Down

0 comments on commit e8b4d6e

Please sign in to comment.