[Exploratory] Capture good assertion messages.#340
Conversation
👍 The less custom code in AVA dealing with this the better :) |
@twada ⬆️ Any thoughts? |
|
@sindresorhus @jamestalmage Sorry for my late response. I'm a little busy these days.
Sure! Please send a pull-req to For wrapOnlyPatterns: [
{
pattern: 't.throws(fn, [message])',
defaultMessage: 'should throw'
},
{
pattern: 't.doesNotThrow(fn, [message]',
defaultMessage: 'should not throw'
}
]to wrapOnlyPatterns: {
't.throws(fn, [message])': {
defaultMessage: 'should throw'
},
't.doesNotThrow(fn, [message]': {
defaultMessage: 'should not throw'
}
} |
|
@jamestalmage Can this be resolved now that |
|
Yep. Relevant changes to |
|
Sorry about pinging you all over the place @jamestalmage, but trying to clean up some long-running PR/issues. What's the next step with this PR? Not saying it should be fixed right now. Just would be useful to know the path forward. |
|
No worries! The issue here would be building up TAP output that would actually show these assertion messages. I think I would like to get a couple other things done first:
|
|
Thanks for the update. Solid plan.
Tape uses
Awesome that we can share some code with Let us know if there's anything @vdemedes and I can help with. Even if it's just feedback on any of those modules. |
|
Yeah sure - I'll file a couple issues on |
|
RE: Neither is technically "right". The contents of TAPs yaml output is completely unspecified as far as I know. As I recall the fancy mocha style diffs only print when using |
|
It's confusing. The v14 draft has examples with both wanted/found and expected/got and expect/got. // @isaacs |
|
Should we track the remaining work in some issues rather than this PR? |
|
@jamestalmage perhaps you could open issues to track remaining work, and then close this PR? |
|
Closing as this will never be merged and remaining todo's are tracked in #723 |
This just is a quick spike exploring the best way to capture assertion messages.
The only place this does not work great is for
wrapOnlyPatterns, since you can end up with a situation wherepowerAssertContextdoes not exist even though theargshas elements that do notstringifywell.@twada - What do you think about moving this logic into
empower-core? Auto populatingevent.computedMessageor similar?Maybe we can offer a standard way to map
wrapOnlyPatternsto messages?