Closed lundibundi closed 6 years ago
Should we also maybe skip message printing if it is not set?
For test.error(err);
we can also skip Expected
and Actual
and print just an error stack.
@tshemsedinov hmm, I have actually been thinking of setting custom values in such cases. I.e 'No error' string as expected in 'error' case etc. As for skipping, I think it would be better to skip stack and only set the 'actual' to make it clear of what the error is.
@lundibundi If no message provided for test.error(err);
we really can print default message, but if we explain that error is not expected here why do we need Expected: null
and Actual: Error message...
?
I didn't suggest to print a message. I wanted to
Expected: No Error
instead of Expected: null
trace
because it's much more clear that we have Expected
and Actual
than just trace
as having trace doesn't explain what the error was (you have to deduce that because this test is error
it means that it must not have an error and therefore trace
is actually the error that has not been expected. Which is in my opinion much less clear than having Actual
and Expected
for every test)PTAL @belochub @tshemsedinov. I addressed the comments, this is left for the follow-up PRs.
Landed in 11b9a228805a11a99955287b1519deb63840a714.
Parts of https://github.com/metarhia/metatests/pull/64 I wanted to have even without
util.inspect
.This case:
Was reported as:
Now it is: