-
Notifications
You must be signed in to change notification settings - Fork 36
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
Make ViewFixture errors more useful #1513
Make ViewFixture errors more useful #1513
Conversation
Completely for this item to be merged, it's one of those things that you can't appreciate good error messages until you have to get to the bottom of these types of issues. Should be straight forward to add some UT coverage for this item too. |
Also worth pointing out that you don't get a call stack when this failure happens, so it's really really hard to figure out what failed. |
Thanks @janhancic. |
👍 |
@janhancic _verifyOnlyOneElementSelected is also used in the setup with 2 arguments. If the ViewFixture is setup with the wrong selector we would now get the following error:
We should either check for the additional args you added or provide a nice message for the case where it fails during setup |
I missed that. I'll submit a fix. |
if (elements.length === 0) { | ||
throw 'No view element found for "' + selector + '"'; | ||
throw 'No view element found for "' + selector + '". Processing property "' + propertyName + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@janhancic here 'selector' isn't a selector, its a view handler. Can you change the arg name to viewHandler
…ill point you to what test line actually failed.
Only display the extra information if two new extra arguments are provided.
b7db19b
to
c73dd11
Compare
…eful Make ViewFixture errors more useful
…eful Make ViewFixture errors more useful
Given this line in a test:
if no element was found for
.my-selector
, you would get this error message:After this change, you get this:
which is obviously much much better as it actually helps you pin point the location in the test where the problem is.