In Sveltekit we can access FormData on they body. But how to create FormData in unit-test?

Viewed 287

I'm trying to unit test a function that expect's a FormData type as described in '@sveltejs/kit/types/helper'.

My question is, how can I create such a FormData type when unit-testing the function?

I tried using the npm form-data package, but did not work as .entries() was missing (and the interface was also completely different).

0 Answers
Related