mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 00:13:12 +09:00
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:
1 parent
467249579d
commit
6f5534c45b
1 file changed
+8
@@ -176,6 +176,10 @@ describe("lib/database", function() {
|
|||||||
() => items.addItem('a', NaN),
|
() => items.addItem('a', NaN),
|
||||||
new Error("count must be a number")
|
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'),
|
() => items.removeItem('a', 'b'),
|
||||||
new Error("count must be a number")
|
new Error("count must be a number")
|
||||||
);
|
);
|
||||||
|
assert.throws(
|
||||||
|
() => items.removeItem('a', "1"),
|
||||||
|
new Error("count must be a number")
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user