From 92b0d0d39b4b5df717d4216b99bd77d62a5889ca Mon Sep 17 00:00:00 2001 From: ankur22 Date: Tue, 5 Mar 2024 12:45:22 +0000 Subject: [PATCH] Add opts to startIteration This will allow callers to pass the NewVU opts, e.g. to set env vars. --- tests/page_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/page_test.go b/tests/page_test.go index 357d12fe5..d2997f6bb 100644 --- a/tests/page_test.go +++ b/tests/page_test.go @@ -822,10 +822,11 @@ func TestPageWaitForFunction(t *testing.T) { // (more importantly) set browser as the mapped browser instance which will // force all tests that work with this to go through the mapping layer. // This returns a cleanup function which should be deferred. -func startIteration(t *testing.T) (*k6test.VU, *goja.Runtime, *[]string, func()) { +// The opts are passed to k6test.NewVU as is without any modification. +func startIteration(t *testing.T, opts ...any) (*k6test.VU, *goja.Runtime, *[]string, func()) { t.Helper() - vu := k6test.NewVU(t) + vu := k6test.NewVU(t, opts...) rt := vu.Runtime() mod := browser.New().NewModuleInstance(vu)