Test for numeric strings in addItem and removeItem

Add tests asserting that numeric strings passed to the addItem and
removeItem methods to ItemDatabes throws.
This commit is contained in:
Hornwitser committed 2019-10-28 19:46:22 +01:00
1 parent 467249579d
commit 6f5534c45b
1 file changed
+8
+8
View File
@@ -176,6 +176,10 @@ describe("lib/database", function() {
() => items.addItem('a', NaN),
new Error("count must be a number")
);
assert.throws(
() => items.addItem('a', "1"),
new Error("count must be a number")
);
});
});
@@ -206,6 +210,10 @@ describe("lib/database", function() {
() => items.removeItem('a', 'b'),
new Error("count must be a number")
);
assert.throws(
() => items.removeItem('a', "1"),
new Error("count must be a number")
);
});
});
});