I have a simple case
.end(function(err, res) {
assert(err == null,'Error is not null => '+ err.stack);
the problem is of course, if err is null, the assert message will still get evaluated, so it will throw a new/preemptive error saying
Uncaught TypeError: Cannot read property 'stack' of null
I know assert is stable and not likely to change, but the feature I am looking for is somthing like this
assert(err == null, function(){
return 'Error is not null => '+ err.stack;
});
this of course means, that the callback will only be evaluated if the assertion fails
hope that makes sense, thanks!
I have a simple case
the problem is of course, if err is null, the assert message will still get evaluated, so it will throw a new/preemptive error saying
I know assert is stable and not likely to change, but the feature I am looking for is somthing like this
this of course means, that the callback will only be evaluated if the assertion fails
hope that makes sense, thanks!