Skip to content

Commit

Permalink
fixup! js/k6/exec: Allow to set state's Tags
Browse files Browse the repository at this point in the history
  • Loading branch information
codebien committed Oct 28, 2021
1 parent 0fec12e commit 85894f8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions js/modules/k6/execution/execution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

0 comments on commit 85894f8

Please sign in to comment.