-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
power-assert
feedback
#96
Comments
@twada Any way we could show the value of |
This is badass. This might actually make me switch to Ava. 💃 |
Currently this:
Outputs:
Is there any way to have it output the old simple output when using direct inputs? Meaning no expressions. Old simple output:
That output is faster to look at. |
@twada @uiureo I've documented the enhanced asserts. Would appriciate your review. Happy to change anything. 89219ce?short_path=0730bb7#diff-0730bb7c2e8f9ea2438b52e419dd86c9 :) |
This is fucking amazing. @sindresorhus, agree on the simple output, looks way better! |
First, as an author of power-assert, I'm so glad to see this happen! 😄
I think it's well written. |
AVA's power-assert output is configured at ava/enhance-assert.js (see If you change empower(assert,
powerAssertFormatter({
renderers: [
powerAssertRenderers.AssertionRenderer,
powerAssertRenderers.DiagramRenderer
]
}),
{
destructive: true,
modifyMessageOnRethrow: true,
saveContextOnRethrow: false,
patterns: module.exports.PATTERNS
}
); You'll get verbose output like
It seems nice to have verbosity configuration options in AVA, and change power-assert renderers according to the option value. |
I know I'm asking a lot, but I would like the following not to use test(t => {
const b = 'bar';
const c = 'baz';
t.is(b, c);
t.end();
}); But this should use test(t => {
const b = 'bar';
const c = 'baz';
const d = 'faz';
t.is(b + d, c);
t.end();
}); |
Currently, What you mean here is that if two arguments are both in form of Identifier or Literal, and its values are simple primitives, AVA's power-assert feature should be turned off automatically. It is not possible now but worth challenging. |
Oh I missed your next question!
test(t => {
const b = 'bar';
const c = 'baz';
const d = 'faz';
t.is(b + d, c);
t.end();
}); Thank you for your clear example! |
It wouldn't nessecarily have to be turned off, could maybe just change the renderer to not show diagrams when |
@sindresorhus Thanks, it's getting a bit easier. |
@twada is |
@vdemedes Not yet. I'm wrestling with Babel6 now. |
Not sure if I should create a new issue for this, but when using promises (await statements),
The result of the promise is not empty, that's for sure :). Seems I was too fast on this one. Apparently, the object shown underneath is the same as the second argument of the assert, which is not the actual result.
|
@SamVerschueren Thank you for reporting! |
Thanks for the feedback! |
@SamVerschueren Looks like #113. |
Sorry, should have looked in the issue list first. |
@SamVerschueren No problem! |
@SamVerschueren - async/await fix is in master. |
Awesome! 👍 |
@sindresorhus is there any more feedback you're looking to collect in this issue, or shall we close it? |
Yup, can be closed in favor of twada/power-assert-renderers#3. |
Opening this just to gather some feedback about the new
power-assert
feature.The text was updated successfully, but these errors were encountered: