diff --git a/js/modules/k6/execution/execution.go b/js/modules/k6/execution/execution.go index 9afce6aa9a3..0814903fc9f 100644 --- a/js/modules/k6/execution/execution.go +++ b/js/modules/k6/execution/execution.go @@ -90,7 +90,7 @@ func (mi *ModuleInstance) Exports() modules.Exports { return modules.Exports{Default: mi.obj} } -var errRunInInitContext = errors.New("getting scenario information in the init context is not supported") +var errRunInInitContext = errors.New("getting scenario information outside of vu code is not supported") // newScenarioInfo returns a goja.Object with property accessors to retrieve // information about the scenario the current VU is running in. diff --git a/js/modules/k6/execution/execution_test.go b/js/modules/k6/execution/execution_test.go index b0e778b39fe..85942aed50a 100644 --- a/js/modules/k6/execution/execution_test.go +++ b/js/modules/k6/execution/execution_test.go @@ -444,6 +444,6 @@ func TestScenarioNoAvailableInInitContext(t *testing.T) { prop := fmt.Sprintf("exec.scenario.%s", code) _, err := rt.RunString(prop) require.Error(t, err) - require.ErrorContains(t, err, "getting scenario information in the init context is not supported") + require.ErrorContains(t, err, "getting scenario information outside of vu code is not supported") } } diff --git a/js/runner_test.go b/js/runner_test.go index e3e7dfb2020..32407118d35 100644 --- a/js/runner_test.go +++ b/js/runner_test.go @@ -2406,7 +2406,7 @@ func TestExecutionInfo(t *testing.T) { {name: "scenario_err", script: ` var exec = require('k6/execution'); exec.scenario; - `, expErr: "getting scenario information in the init context is not supported"}, + `, expErr: "getting scenario information outside of vu code is not supported"}, {name: "test_ok", script: ` var exec = require('k6/execution');