提交 bd0ca278 编写于 作者: B Ben Carp

adding toFormData test

上级 d99d5faa
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")
});
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册