GeezerVison is showing github.com — Updated DevTools test setup to no longer mock test renerer · react/react@177f357
File treeExpand file treeCollapse file tree Open diff view settings packages/react-devtools-shared/src/__tests__
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/react-devtools-shared/src/__tests__/__snapshots__/treeContext-test.js.snap +42Lines changed: 42 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1091,6 +1091,48 @@ Object { | 1091 | 1091 | } | 1092 | 1092 | `; | 1093 | 1093 |
| | 1094 | +exports[`TreeListContext tree state should select the next and previous elements in the tree: 3: select element after (0) 1`] = ` | | 1095 | +Object { | | 1096 | + "inspectedElementID": 3, | | 1097 | + "numElements": 4, | | 1098 | + "ownerFlatTree": null, | | 1099 | + "ownerID": null, | | 1100 | + "searchIndex": null, | | 1101 | + "searchResults": Array [], | | 1102 | + "searchText": "", | | 1103 | + "selectedElementID": 3, | | 1104 | + "selectedElementIndex": 1, | | 1105 | +} | | 1106 | +`; | | 1107 | +
| | 1108 | +exports[`TreeListContext tree state should select the next and previous elements in the tree: 3: select element after (1) 1`] = ` | | 1109 | +Object { | | 1110 | + "inspectedElementID": 4, | | 1111 | + "numElements": 4, | | 1112 | + "ownerFlatTree": null, | | 1113 | + "ownerID": null, | | 1114 | + "searchIndex": null, | | 1115 | + "searchResults": Array [], | | 1116 | + "searchText": "", | | 1117 | + "selectedElementID": 4, | | 1118 | + "selectedElementIndex": 2, | | 1119 | +} | | 1120 | +`; | | 1121 | +
| | 1122 | +exports[`TreeListContext tree state should select the next and previous elements in the tree: 3: select element after (2) 1`] = ` | | 1123 | +Object { | | 1124 | + "inspectedElementID": 5, | | 1125 | + "numElements": 4, | | 1126 | + "ownerFlatTree": null, | | 1127 | + "ownerID": null, | | 1128 | + "searchIndex": null, | | 1129 | + "searchResults": Array [], | | 1130 | + "searchText": "", | | 1131 | + "selectedElementID": 5, | | 1132 | + "selectedElementIndex": 3, | | 1133 | +} | | 1134 | +`; | | 1135 | +
| 1094 | 1136 | exports[`TreeListContext tree state should select the next and previous elements in the tree: 3: select element after (0) 1`] = ` | 1095 | 1137 | Object { | 1096 | 1138 | "inspectedElementID": 3, | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-devtools-shared/src/__tests__/setupEnv.js -10Lines changed: 0 additions & 10 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | 'use strict'; | 2 | 2 |
| 3 | | -// Import test renderer and then reset modules for two reasons: | 4 | | -// 1. We don't want test renderer connected to the DevTools hooks. | 5 | | -// 2. This enables us to work around the on-renderer limitation. | 6 | | -// TODO This (or the resetModules below) might be the cause of the hooks erorr in some tests | 7 | | -const ReactTestRenderer = require.requireActual('react-test-renderer'); | 8 | | - | 9 | | -jest.resetModules(); | 10 | | - | 11 | | -jest.mock('react-test-renderer', () => ReactTestRenderer); | 12 | | - | 13 | 3 | // DevTools stores preferences between sessions in localStorage | 14 | 4 | if (!global.hasOwnProperty('localStorage')) { | 15 | 5 | global.localStorage = require('local-storage-fallback').default; | |
|