mirror of
https://github.com/tenrok/axios.git
synced 2026-05-18 12:39:44 +03:00
d660e29c1a
This reverts commit 73e3bdb883.
19 lines
536 B
JavaScript
19 lines
536 B
JavaScript
var toFormData = require("../../../lib/helpers/toFormData");
|
|
|
|
describe("toFormData", function () {
|
|
it("Convert nested data object to FormDAta", function () {
|
|
var o = {
|
|
val: 123,
|
|
nested: {
|
|
arr: ["hello", "world"],
|
|
},
|
|
};
|
|
|
|
convertedVal = toFormData(o);
|
|
expect(convertedVal instanceof FormData).toEqual(true);
|
|
expect(Array.from(convertedVal.keys()).length).toEqual(3);
|
|
expect(convertedVal.get("val")).toEqual("123")
|
|
expect(convertedVal.get("nested.arr.0")).toEqual("hello")
|
|
});
|
|
});
|