@@ -39,6 +39,10 @@ function normalizeCodeLocInfo(str) {
3939) ;
4040}
4141
42+ function normalizeSerializedContent ( str ) {
43+ return str . replaceAll ( __REACT_ROOT_PATH_TEST__ , '**' ) ;
44+ }
45+
4246describe ( 'ReactFlightDOMEdge' , ( ) => {
4347beforeEach ( ( ) => {
4448// Mock performance.now for timing tests
@@ -481,8 +485,10 @@ describe('ReactFlightDOMEdge', () => {
481485) ;
482486const [ stream1 , stream2 ] = passThrough ( stream ) . tee ( ) ;
483487
484- const serializedContent = await readResult ( stream1 ) ;
485- expect ( serializedContent . length ) . toBeLessThan ( 1100 ) ;
488+ const serializedContent = normalizeSerializedContent (
489+ await readResult ( stream1 ) ,
490+ ) ;
491+ expect ( serializedContent . length ) . toBeLessThan ( 1075 ) ;
486492
487493const result = await ReactServerDOMClient . createFromReadableStream (
488494stream2 ,
@@ -551,9 +557,11 @@ describe('ReactFlightDOMEdge', () => {
551557) ;
552558const [ stream1 , stream2 ] = passThrough ( stream ) . tee ( ) ;
553559
554- const serializedContent = await readResult ( stream1 ) ;
560+ const serializedContent = normalizeSerializedContent (
561+ await readResult ( stream1 ) ,
562+ ) ;
555563
556- expect ( serializedContent . length ) . toBeLessThan ( 490 ) ;
564+ expect ( serializedContent . length ) . toBeLessThan ( 465 ) ;
557565expect ( timesRendered ) . toBeLessThan ( 5 ) ;
558566
559567const model = await ReactServerDOMClient . createFromReadableStream ( stream2 , {
@@ -623,8 +631,10 @@ describe('ReactFlightDOMEdge', () => {
623631) ;
624632const [ stream1 , stream2 ] = passThrough ( stream ) . tee ( ) ;
625633
626- const serializedContent = await readResult ( stream1 ) ;
627- expect ( serializedContent . length ) . toBeLessThan ( __DEV__ ? 680 : 400 ) ;
634+ const serializedContent = normalizeSerializedContent (
635+ await readResult ( stream1 ) ,
636+ ) ;
637+ expect ( serializedContent . length ) . toBeLessThan ( __DEV__ ? 630 : 400 ) ;
628638expect ( timesRendered ) . toBeLessThan ( 5 ) ;
629639
630640const model = await serverAct ( ( ) =>
@@ -657,8 +667,10 @@ describe('ReactFlightDOMEdge', () => {
657667< ServerComponent recurse = { 20 } /> ,
658668) ,
659669) ;
660- const serializedContent = await readResult ( stream ) ;
661- const expectedDebugInfoSize = __DEV__ ? 320 * 20 : 0 ;
670+ const serializedContent = normalizeSerializedContent (
671+ await readResult ( stream ) ,
672+ ) ;
673+ const expectedDebugInfoSize = __DEV__ ? 295 * 20 : 0 ;
662674expect ( serializedContent . length ) . toBeLessThan ( 150 + expectedDebugInfoSize ) ;
663675} ) ;
664676
0 commit comments