Skip to content

Commit 837b8a1

Browse files
Mallikarjun-0ljharb
authored andcommitted
[Tests] add tests to check the behavior of getBoundary with non-strings
1 parent 426ba9a commit 837b8a1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/integration/test-set-boundary.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,13 @@ var FormData = require(common.dir.lib + '/form_data');
2323
assert.equal(formA.getBoundary(), userBoundary);
2424
assert.notEqual(formA.getBoundary(), formB.getBoundary());
2525
}());
26+
27+
(function testsetBoundaryWithNonString_preExistingBehavior() {
28+
var form = new FormData();
29+
30+
var nonStringValues = [123, { value: 123 }, ['---something']];
31+
nonStringValues.forEach(function (value) {
32+
form.setBoundary(value);
33+
assert.equal(form.getBoundary(), value);
34+
});
35+
}());

0 commit comments

Comments
 (0)