-
Notifications
You must be signed in to change notification settings - Fork 142
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
rename or alias td.explain().description to .message #314
Comments
Is throwing any ol' not-error-but-object-that-has-a- |
Depends on your definition of "legit". Have seen a few error modules that define custom Error classes. I think most test utility AssertionError type objects are in the same boat. (only the "good" ones actually set their prototype to But beyond that, just seems like legit duck typing to me, since most test frameworks (teenytest included) expect to receive some form of assertion error or Error-like object. But they don't type-check against Error; instead just printing Anyway, my use-case: Whenever needing I generally find it easier to just Seems like a nice extra affordance with not too much downside. (Well, other than the eventual migration from |
ah, clever! I think that makes sense. Have you spiked to confirm that this would work? |
Sample test output when console-logging the td.explain output:
Same test but
After simply changing
It definitely works as desired. The Evidently, chrome/node's console.log method does not invoke |
Dayum, that is some interesting detail on Node's console's |
Stale. Closing. Please reopen if still relevant and I will look into it. |
This would allow
throw td.explain(foo)
to print in a naturally helpful way.Also thinking the explain return value should have description == .toString()
Thoughts?
The text was updated successfully, but these errors were encountered: