-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Testing Infrastructure
-
Server Tooling & Methods
Currently assert() will accept non-boolean values, and tests them for truthyness/falsiness. Sometimes this is desirable, but it may permit problems such as mistakenly testing an object, or a function itself (rather than its return value), and so on.
It would be better if assert() only accepted boolean values, and situations where the author wants to test a non-boolean value should explicitly declare that by using assert.truthy() and/or assert.falsy() helper functions.
- related to
-
SERVER-12476 assert() calls that can't fail because of constant-value arguments
- Closed