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

Fix errors when identity-obj-proxy mocks CSS Modules #4935

Merged
merged 2 commits into from
Nov 22, 2017

Conversation

pedrottimark
Copy link
Contributor

Summary

Fixes #4580 and #4922

Because the mock identity object for CSS Modules returns the key as the value for any key:

  • Comparing sentinel properties to true avoids false positive in Immutable plugin test method
  • Comparing val.constructor === 'function' avoids undefined as name of object

See Mocking CSS Modules

Test plan

Added 2 tests which failed before changes to code, and then fixed them to fail for right reason :)

@codecov-io
Copy link

Codecov Report

Merging #4935 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4935      +/-   ##
==========================================
+ Coverage   60.26%   60.27%   +0.01%     
==========================================
  Files         198      198              
  Lines        6593     6595       +2     
  Branches        3        3              
==========================================
+ Hits         3973     3975       +2     
  Misses       2620     2620
Impacted Files Coverage Δ
packages/pretty-format/src/index.js 96.45% <100%> (+0.05%) ⬆️
packages/pretty-format/src/plugins/immutable.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5800f47...f6eb0ad. Read the comment docs.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and clean 🙂

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Snapshot failing with val.forEach is not a function
6 participants