Skip to content

Commit b345ec0

Browse files
committed
test: update react-createelement comparison tests with 5000 nested nodes and fix typings
- Changed rerender to use React.cloneElement<any> for proper typing - Updated NUM_NODES constant to 5000 for nested structure tests - Removed redundant comments about node count reduction to prevent stack overflow
1 parent cb842c8 commit b345ec0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tests/react-createelement-comparison.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async function measureMemoryOnUpdate(element: React.ReactElement, options?: { st
5555

5656
for (let j = 0; j < stateChanges; j++) {
5757
// Re-render with a changing prop to simulate state updates
58-
rerender(React.cloneElement(element, { 'data-state': j }))
58+
rerender(React.cloneElement<any>(element, { 'data-state': j }))
5959
}
6060

6161
if (i >= warmups) {
@@ -70,7 +70,7 @@ async function measureMemoryOnUpdate(element: React.ReactElement, options?: { st
7070
}
7171

7272
describe('React.createElement vs MeoNode Comparison', () => {
73-
const NUM_NODES = 5000 // Reduced from 10k to prevent stack overflow in deeply nested tests
73+
const NUM_NODES = 5000 // Test with 5000 nodes for nested structures
7474
// Table to store results - will be created fresh for the final output
7575
let resultsTable: Table.Table
7676

@@ -179,8 +179,6 @@ describe('React.createElement vs MeoNode Comparison', () => {
179179
})
180180

181181
it('should compare 5,000 nested nodes between React.createElement and MeoNode', async () => {
182-
// Reduced to 5k to prevent stack overflow in deeply nested structures
183-
184182
// React.createElement implementation (deeply nested)
185183
const createReactElementNestedNodes = () => {
186184
let nestedNode = React.createElement('div', null, `Deepest Node`)

0 commit comments

Comments
 (0)