Skip to content

Commit

Permalink
Add test for #2480
Browse files Browse the repository at this point in the history
  • Loading branch information
mstoykov committed Apr 6, 2022
1 parent 4bc12a2 commit 355a8e2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions js/modules/k6/http/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,16 @@ func TestHTTPFile(t *testing.T) {
})
}
}

func TestHTTPFileDataInRequest(t *testing.T) {
t.Parallel()

tb, _, _, rt, _ := newRuntime(t) //nolint:dogsled
_, err := rt.RunString(tb.Replacer.Replace(`
let f = http.file("something");
let res = http.request("POST", "HTTPBIN_URL/post", f.data);
if (res.status != 200) {
throw new Error("Unexpected status " + res.status)
}`))
require.NoError(t, err)
}

0 comments on commit 355a8e2

Please sign in to comment.