Skip to content

Conversation

novemberborn
Copy link
Member

At best it saves one stack level, but AVA code is already filtered out
of the stacks, so this is really quite unnecessary.
Format statements, generate diffs and otherwise format values when
AssertionErrors are created. Make labels contextual to the assertion.

Always print power-assert statements in mini and verbose reporters, but
after the values. Accept the duplication when the statement covers the
value passed to the assertion.

Detect whether `t.throws()` failed because no error was thrown, or because
the thrown error did not meet expectations.

Explicitly test `t.fail()` default message in assertion test.
Only print the first level. For arrays/maps/objects/sets this means the
indexes/keys are printed. Presumably since we do print all statements
this provides enough context.
@vadimdemedes
Copy link
Contributor

vadimdemedes commented Mar 15, 2017

Damn it, Mark is on a row!

Rather than printing Actual/Expected, vary those labels by the assertion, depending on whether the assertion was improperly used or failed. This creates more helpful output

Big fan of this change, removes the need to guess what output means.

@sotojuan
Copy link
Contributor

LGTM as well. Great!

@sindresorhus sindresorhus merged commit f062981 into master Mar 17, 2017
@sindresorhus sindresorhus deleted the more-assertion-changes branch March 17, 2017 09:08
@sindresorhus
Copy link
Member

🙌 Great as always.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants