Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

adding a clearer expectation failed message for toHaveData matcher #116

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

fmobus commented Mar 5, 2013

Currently, when a toHaveData matcher fails, it's a bit non-specific as to why it has failed, simply saying it expected the element to have a data-attribute named as expected.

This patch makes the expectation failed message more specific, differentiating between the following cases:

  • data attribute was not present at all or no expected value was passed
  • data attribtue was present, but its value does not match the expected value

Also: I am not entirely satisfied with the way I wrote those tests, and appreciate feedbak on that :)

Collaborator

travisjeffery commented Apr 27, 2013

Not sure on this one, it's pretty inconsistent with the rest of the api.

Collaborator

travisjeffery commented Sep 2, 2013

If you make this throw an actual exception then i'd be cool with that.

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