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(pretty-format): correctly detect memo #9196

Merged
merged 1 commit into from Nov 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Expand Up @@ -53,8 +53,9 @@
- `[jest-snapshot]` [**BREAKING**] Distinguish empty string from internal snapshot not written ([#8898](https://github.com/facebook/jest/pull/8898))
- `[jest-snapshot]` [**BREAKING**] Remove `report` method and throw matcher errors ([#9049](https://github.com/facebook/jest/pull/9049))
- `[jest-transform]` Properly cache transformed files across tests ([#8890](https://github.com/facebook/jest/pull/8890))
- `[jest-utils]` Allow querying process.domain ([#9136](https://github.com/facebook/jest/pull/9136))
- `[jest-transform]` Don't fail the test suite when a generated source map is invalid ([#9058](https://github.com/facebook/jest/pull/9058))
- `[jest-utils]` Allow querying process.domain ([#9136](https://github.com/facebook/jest/pull/9136))
- `[pretty-format]` Correctly detect memoized elements ([#9196](https://github.com/facebook/jest/pull/9196))

### Chore & Maintenance

Expand Down
2 changes: 1 addition & 1 deletion packages/jest-fake-timers/package.json
Expand Up @@ -17,7 +17,7 @@
"lolex": "^5.0.0"
},
"devDependencies": {
"@types/lolex": "^3.1.1"
"@types/lolex": "^5.1.0"
},
"engines": {
"node": ">= 8"
Expand Down
2 changes: 1 addition & 1 deletion packages/pretty-format/package.json
Expand Up @@ -16,7 +16,7 @@
"@jest/types": "^24.9.0",
"ansi-regex": "^5.0.0",
"ansi-styles": "^4.0.0",
"react-is": "^16.8.4"
"react-is": "^16.12.0"
},
"devDependencies": {
"@types/react": "*",
Expand Down
2 changes: 1 addition & 1 deletion packages/pretty-format/src/plugins/ReactElement.ts
Expand Up @@ -60,7 +60,7 @@ const getType = (element: any) => {
: 'ForwardRef';
}

if (ReactIs.isMemo(type)) {
if (ReactIs.isMemo(element)) {
const functionName =
type.displayName || type.type.displayName || type.type.name || '';

Expand Down