Skip to content

Commit

Permalink
Use struct literal thanks to @imiric
Browse files Browse the repository at this point in the history
  • Loading branch information
mstoykov committed Aug 5, 2021
1 parent c698c5c commit 409c457
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions js/modules/k6/metrics/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ func TestMetrics(t *testing.T) {
t.Parallel()
rt := goja.New()
rt.SetFieldNameMapper(common.FieldNameMapper{})
mii := &modulestest.InstanceCore{}
mii.Runtime = rt
mii.InitEnv = &common.InitEnvironment{}
mii.Ctx = context.Background()
mii := &modulestest.InstanceCore{
Runtime: rt,
InitEnv: &common.InitEnvironment{},
Ctx: context.Background(),
}
m, ok := New().NewModuleInstance(mii).(*ModuleInstance)
require.True(t, ok)
require.NoError(t, rt.Set("metrics", m.GetExports().Named))
Expand Down Expand Up @@ -179,10 +180,11 @@ func TestMetricGetName(t *testing.T) {
rt := goja.New()
rt.SetFieldNameMapper(common.FieldNameMapper{})

mii := &modulestest.InstanceCore{}
mii.Runtime = rt
mii.InitEnv = &common.InitEnvironment{}
mii.Ctx = context.Background()
mii := &modulestest.InstanceCore{
Runtime: rt,
InitEnv: &common.InitEnvironment{},
Ctx: context.Background(),
}
m, ok := New().NewModuleInstance(mii).(*ModuleInstance)
require.True(t, ok)
require.NoError(t, rt.Set("metrics", m.GetExports().Named))
Expand Down

0 comments on commit 409c457

Please sign in to comment.