Skip to content
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

Jest 21 expects result.message to always be a function #147

Merged
merged 1 commit into from
Aug 29, 2017

Conversation

nigelzor
Copy link
Contributor

When using jest-enzyme with pre-release versions of Jest, failed assertions don't display correctly. Instead of seeing a useful description of the failed assertion, we get TypeError: message is not a function.

Returning a function remains compatible with older versions of Jest.

ref: jestjs/jest#3921
ref: jestjs/jest#3972

@blainekasten
Copy link
Collaborator

This looks legit! Do you know how far back this function support was introduced in jest? Just trying to think through if we should make this a major breaking change or if we can get away with a patch change here.

@nigelzor
Copy link
Contributor Author

Just a patch, I think. The handling for function-typed message goes back to Jest 14, and expect.extend wasn't added until after that (Jest 17).

@blainekasten
Copy link
Collaborator

Brilliant. Thanks for the work!

@blainekasten blainekasten merged commit 8d3aa42 into enzymejs:master Aug 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants