@@ -170,13 +170,13 @@ describe('streamServerRenderedReactComponent', () => {
170170 } ) ;
171171
172172 expect ( onError ) . toHaveBeenCalled ( ) ;
173- expect ( chunks ) . toHaveLength ( 2 ) ;
173+ expect ( chunks . length ) . toBeGreaterThanOrEqual ( 2 ) ;
174174 expect ( chunks [ 0 ] . html ) . toContain ( 'Header In The Shell' ) ;
175175 expect ( chunks [ 0 ] . consoleReplayScript ) . toBe ( '' ) ;
176176 expect ( chunks [ 0 ] . hasErrors ) . toBe ( false ) ;
177177 expect ( chunks [ 0 ] . isShellReady ) . toBe ( true ) ;
178178 // Script that fallbacks the render to client side
179- expect ( chunks [ 1 ] . html ) . toMatch ( / < s c r i p t > [ . \s \S ] * A s y n c E r r o r [ . \s \S ] * < \/ s c r i p t > / ) ;
179+ expect ( chunks [ 1 ] . html ) . toMatch ( / t h e s e r v e r r e n d e r i n g e r r o r e d : \\ n \\ n A s y n c E r r o r / ) ;
180180 expect ( chunks [ 1 ] . consoleReplayScript ) . toBe ( '' ) ;
181181 expect ( chunks [ 1 ] . hasErrors ) . toBe ( true ) ;
182182 expect ( chunks [ 1 ] . isShellReady ) . toBe ( true ) ;
@@ -191,13 +191,13 @@ describe('streamServerRenderedReactComponent', () => {
191191 } ) ;
192192
193193 expect ( onError ) . not . toHaveBeenCalled ( ) ;
194- expect ( chunks ) . toHaveLength ( 2 ) ;
194+ expect ( chunks . length ) . toBeGreaterThanOrEqual ( 2 ) ;
195195 expect ( chunks [ 0 ] . html ) . toContain ( 'Header In The Shell' ) ;
196196 expect ( chunks [ 0 ] . consoleReplayScript ) . toBe ( '' ) ;
197197 expect ( chunks [ 0 ] . hasErrors ) . toBe ( false ) ;
198198 expect ( chunks [ 0 ] . isShellReady ) . toBe ( true ) ;
199199 // Script that fallbacks the render to client side
200- expect ( chunks [ 1 ] . html ) . toMatch ( / < s c r i p t > [ . \s \S ] * A s y n c E r r o r [ . \s \S ] * < \/ s c r i p t > / ) ;
200+ expect ( chunks [ 1 ] . html ) . toMatch ( / t h e s e r v e r r e n d e r i n g e r r o r e d : \\ n \\ n A s y n c E r r o r / ) ;
201201 expect ( chunks [ 1 ] . consoleReplayScript ) . toBe ( '' ) ;
202202 expect ( chunks [ 1 ] . hasErrors ) . toBe ( true ) ;
203203 expect ( chunks [ 1 ] . isShellReady ) . toBe ( true ) ;
@@ -241,12 +241,12 @@ describe('streamServerRenderedReactComponent', () => {
241241 const { renderResult, chunks } = setupStreamTest ( { componentType, throwAsyncError : true } ) ;
242242 await new Promise ( ( resolve ) => renderResult . on ( 'end' , resolve ) ) ;
243243
244- expect ( chunks ) . toHaveLength ( 2 ) ;
244+ expect ( chunks . length ) . toBeGreaterThanOrEqual ( 2 ) ;
245245 expect ( chunks [ 0 ] . html ) . toContain ( 'Header In The Shell' ) ;
246246 expect ( chunks [ 0 ] . consoleReplayScript ) . toBe ( '' ) ;
247247 expect ( chunks [ 0 ] . hasErrors ) . toBe ( false ) ;
248248 expect ( chunks [ 0 ] . isShellReady ) . toBe ( true ) ;
249- expect ( chunks [ 1 ] . html ) . toMatch ( / < s c r i p t > [ . \s \S ] * A s y n c E r r o r [ . \s \S ] * < \/ s c r i p t > / ) ;
249+ expect ( chunks [ 1 ] . html ) . toMatch ( / t h e s e r v e r r e n d e r i n g e r r o r e d : \\ n \\ n A s y n c E r r o r / ) ;
250250 expect ( chunks [ 1 ] . consoleReplayScript ) . toBe ( '' ) ;
251251 expect ( chunks [ 1 ] . hasErrors ) . toBe ( true ) ;
252252 expect ( chunks [ 1 ] . isShellReady ) . toBe ( true ) ;
0 commit comments