feat: Add File support in FormData
@@ -73,6 +73,15 @@ unitTest(function formDataParamsSetSuccess(): void {
assertEquals(formData.get("e"), "null");
});
+unitTest(function fromDataUseDomFile(): void {
+ const formData = new FormData();
+ const file = new File(["foo"], "bar", {
+ type: "text/plain",
+ });
+ formData.append("file", file);
+ assertEquals(formData.get("file"), file);
+});
+
unitTest(function formDataSetEmptyBlobSuccess(): void {
const formData = new FormData();
formData.set("a", new Blob([]), "blank.txt");
