Skip to content

Commit a8b028d

Browse files
committed
Add test case for FormParser to handle empty string values
1 parent 8581bfb commit a8b028d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/lib/form-parser.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ describe(FormParser.name, () => {
2525
test("#string", () => {
2626
let formData = new FormData();
2727
formData.set("name", "Alice");
28+
formData.set("age", "");
2829

2930
let parser = new FormParser(formData);
3031

3132
expect(parser.string("name")).toBe("Alice");
33+
expect(parser.string("age")).toBe("");
3234
});
3335

3436
test("#string throw if the key is missing", () => {

0 commit comments

Comments
 (0)