@@ -160,16 +160,14 @@ describe('ReactSuspenseFuzz', () => {
160160 ) ;
161161
162162 resetCache ( ) ;
163- ReactNoop . renderToRootWithID (
163+ const expectedRoot = ReactNoop . createRoot ( ) ;
164+ expectedRoot . render (
164165 < ShouldSuspendContext . Provider value = { false } >
165166 { children }
166167 </ ShouldSuspendContext . Provider > ,
167- 'expected' ,
168168 ) ;
169169 resolveAllTasks ( ) ;
170- const expectedOutput = ReactNoop . getChildrenAsJSX ( 'expected' ) ;
171- ReactNoop . renderToRootWithID ( null , 'expected' ) ;
172- Scheduler . unstable_flushWithoutYielding ( ) ;
170+ const expectedOutput = expectedRoot . getChildrenAsJSX ( ) ;
173171
174172 resetCache ( ) ;
175173 ReactNoop . renderLegacySyncRoot ( children ) ;
@@ -179,13 +177,18 @@ describe('ReactSuspenseFuzz', () => {
179177 ReactNoop . renderLegacySyncRoot ( null ) ;
180178
181179 resetCache ( ) ;
182- ReactNoop . renderToRootWithID ( children , 'concurrent' ) ;
183- Scheduler . unstable_flushWithoutYielding ( ) ;
180+ const batchedSyncRoot = ReactNoop . createSyncRoot ( ) ;
181+ batchedSyncRoot . render ( children ) ;
182+ resolveAllTasks ( ) ;
183+ const batchedSyncOutput = batchedSyncRoot . getChildrenAsJSX ( ) ;
184+ expect ( batchedSyncOutput ) . toEqual ( expectedOutput ) ;
185+
186+ resetCache ( ) ;
187+ const concurrentRoot = ReactNoop . createRoot ( ) ;
188+ concurrentRoot . render ( children ) ;
184189 resolveAllTasks ( ) ;
185- const concurrentOutput = ReactNoop . getChildrenAsJSX ( 'concurrent' ) ;
190+ const concurrentOutput = concurrentRoot . getChildrenAsJSX ( ) ;
186191 expect ( concurrentOutput ) . toEqual ( expectedOutput ) ;
187- ReactNoop . renderToRootWithID ( null , 'concurrent' ) ;
188- Scheduler . unstable_flushWithoutYielding ( ) ;
189192 }
190193
191194 function pickRandomWeighted ( rand , options ) {
@@ -321,7 +324,7 @@ describe('ReactSuspenseFuzz', () => {
321324 ) ;
322325 } ) ;
323326
324- it ( ' generative tests' , ( ) => {
327+ it ( ` generative tests (random seed: ${ SEED } )` , ( ) => {
325328 const { generateTestCase, testResolvedOutput} = createFuzzer ( ) ;
326329
327330 const rand = Random . create ( SEED ) ;
0 commit comments