-
Type:
Improvement
-
Resolution: Done
-
Priority:
Minor - P4
-
Affects Version/s: None
-
Component/s: Shell, Testing Infrastructure
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Analogue to assert.throws. Should be used to self-document when the expected failure mode for a test case is for an exception to be thrown. Will output a stack trace through doassert (note that output generated for uncaught exceptions currently does not even include a line number).
assert.doesNotThrow = function(func, params, msg) { ... }; assert.doesNotThrow.automsg = function(func, params) { ... };
Example usage:
assert.doesNotThrow(function() { db.foo.find({a:{$gt:0}}).itcount(); }, [], "testing that the $gt operator is recognized");