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

[expect] Fix TypeError in toBeInstanceOf on null or undefined #6912

Merged
merged 4 commits into from
Aug 30, 2018
Merged

[expect] Fix TypeError in toBeInstanceOf on null or undefined #6912

merged 4 commits into from
Aug 30, 2018

Commits on Aug 30, 2018

  1. matchers.js: toBeInstanceOf() shouldn't error on null/undefined

    If using toBeInstanceOf() on an undefined or null value Jest attempts to read `undefined.constructor` which generates an unhelpful error along the lines of "TypeError: Cannot read property 'constructor' of undefined".
    
    This fixes the bug so that it's more robust and returns the normal matcher error like "Expected X, received X"
    dhoulb authored and SimenB committed Aug 30, 2018
    Configuration menu
    Copy the full SHA
    f647a6e View commit details
    Browse the repository at this point in the history
  2. Update changelog

    dhoulb authored and SimenB committed Aug 30, 2018
    Configuration menu
    Copy the full SHA
    e26db2d View commit details
    Browse the repository at this point in the history
  3. Update matchers.js

    SimenB authored Aug 30, 2018
    Configuration menu
    Copy the full SHA
    0903f17 View commit details
    Browse the repository at this point in the history
  4. rebase, blah

    SimenB committed Aug 30, 2018
    Configuration menu
    Copy the full SHA
    96c4f69 View commit details
    Browse the repository at this point in the history