@@ -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', () => {
4347 beforeEach(() => {
4448 // Mock performance.now for timing tests
@@ -481,8 +485,10 @@ describe('ReactFlightDOMEdge', () => {
481485 );
482486 const [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
487493 const result = await ReactServerDOMClient.createFromReadableStream(
488494 stream2,
@@ -551,9 +557,11 @@ describe('ReactFlightDOMEdge', () => {
551557 );
552558 const [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 );
557565 expect(timesRendered).toBeLessThan(5);
558566
559567 const model = await ReactServerDOMClient.createFromReadableStream(stream2, {
@@ -623,8 +631,10 @@ describe('ReactFlightDOMEdge', () => {
623631 );
624632 const [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);
628638 expect(timesRendered).toBeLessThan(5);
629639
630640 const 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;
662674 expect(serializedContent.length).toBeLessThan(150 + expectedDebugInfoSize);
663675 });
664676
0 commit comments