Skip to content

Commit

Permalink
fix(pretty-format): correctly detect memo (#9196)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored Nov 17, 2019
1 parent ac3f2a5 commit 03b97d6
Show file tree
Hide file tree
Showing 5 changed files with 259 additions and 218 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit 03b97d6

Please sign in to comment.