From 85894f8c0747cd07fb6a8ddf4cc7e18b4213878f Mon Sep 17 00:00:00 2001 From: Ivan <2103732+codebien@users.noreply.github.com> Date: Thu, 28 Oct 2021 11:45:48 +0200 Subject: [PATCH] fixup! js/k6/exec: Allow to set state's Tags --- js/modules/k6/execution/execution_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/modules/k6/execution/execution_test.go b/js/modules/k6/execution/execution_test.go index 1a115c9779a..216742a0891 100644 --- a/js/modules/k6/execution/execution_test.go +++ b/js/modules/k6/execution/execution_test.go @@ -76,4 +76,9 @@ func TestVUTags(t *testing.T) { tag, err = rt.RunString(`exec.vu.tags["custom-tag"]`) require.NoError(t, err) assert.Equal(t, "mytag", tag.String()) + + // json encoding + encoded, err := rt.RunString(`JSON.stringify(exec.vu.tags)`) + require.NoError(t, err) + assert.Equal(t, `{"vu":"101","custom-tag":"mytag"}`, encoded.String()) }