Skip to content

Commit 177f357

Browse files
author
Brian Vaughn
committed
Updated DevTools test setup to no longer mock test renerer
1 parent a48593a commit 177f357

File tree

2 files changed

+42
-10
lines changed

2 files changed

+42
-10
lines changed

packages/react-devtools-shared/src/__tests__/__snapshots__/treeContext-test.js.snap

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,48 @@ Object {
10911091
}
10921092
`;
10931093
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+
10941136
exports[`TreeListContext tree state should select the next and previous elements in the tree: 3: select element after (0) 1`] = `
10951137
Object {
10961138
"inspectedElementID": 3,

packages/react-devtools-shared/src/__tests__/setupEnv.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
'use strict';
22

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-
133
// DevTools stores preferences between sessions in localStorage
144
if (!global.hasOwnProperty('localStorage')) {
155
global.localStorage = require('local-storage-fallback').default;

0 commit comments

Comments
 (0)