@@ -56,7 +56,6 @@ describe('ReactDOMFizzStaticNode', () => {
5656 }
5757 }
5858
59- // @gate enableHalt
6059 it ( 'should call prerenderToNodeStream' , async ( ) => {
6160 const result = await ReactDOMFizzStatic . prerenderToNodeStream (
6261 < div > hello world</ div > ,
@@ -65,14 +64,12 @@ describe('ReactDOMFizzStaticNode', () => {
6564 expect ( prelude ) . toMatchInlineSnapshot ( `"<div>hello world</div>"` ) ;
6665 } ) ;
6766
68- // @gate enableHalt
6967 it ( 'should suppport web streams' , async ( ) => {
7068 const result = await ReactDOMFizzStatic . prerender ( < div > hello world</ div > ) ;
7169 const prelude = await readContentWeb ( result . prelude ) ;
7270 expect ( prelude ) . toMatchInlineSnapshot ( `"<div>hello world</div>"` ) ;
7371 } ) ;
7472
75- // @gate enableHalt
7673 it ( 'should emit DOCTYPE at the root of the document' , async ( ) => {
7774 const result = await ReactDOMFizzStatic . prerenderToNodeStream (
7875 < html >
@@ -91,7 +88,6 @@ describe('ReactDOMFizzStaticNode', () => {
9188 }
9289 } ) ;
9390
94- // @gate enableHalt
9591 it ( 'should emit bootstrap script src at the end' , async ( ) => {
9692 const result = await ReactDOMFizzStatic . prerenderToNodeStream (
9793 < div > hello world</ div > ,
@@ -107,7 +103,6 @@ describe('ReactDOMFizzStaticNode', () => {
107103 ) ;
108104 } ) ;
109105
110- // @gate enableHalt
111106 it ( 'emits all HTML as one unit' , async ( ) => {
112107 let hasLoaded = false ;
113108 let resolve ;
@@ -137,7 +132,6 @@ describe('ReactDOMFizzStaticNode', () => {
137132 expect ( prelude ) . toMatchInlineSnapshot ( `"<div><!--$-->Done<!--/$--></div>"` ) ;
138133 } ) ;
139134
140- // @gate enableHalt
141135 it ( 'should reject the promise when an error is thrown at the root' , async ( ) => {
142136 const reportedErrors = [ ] ;
143137 let caughtError = null ;
@@ -159,7 +153,6 @@ describe('ReactDOMFizzStaticNode', () => {
159153 expect ( reportedErrors ) . toEqual ( [ theError ] ) ;
160154 } ) ;
161155
162- // @gate enableHalt
163156 it ( 'should reject the promise when an error is thrown inside a fallback' , async ( ) => {
164157 const reportedErrors = [ ] ;
165158 let caughtError = null ;
@@ -183,7 +176,6 @@ describe('ReactDOMFizzStaticNode', () => {
183176 expect ( reportedErrors ) . toEqual ( [ theError ] ) ;
184177 } ) ;
185178
186- // @gate enableHalt
187179 it ( 'should not error the stream when an error is thrown inside suspense boundary' , async ( ) => {
188180 const reportedErrors = [ ] ;
189181 const result = await ReactDOMFizzStatic . prerenderToNodeStream (
@@ -204,7 +196,6 @@ describe('ReactDOMFizzStaticNode', () => {
204196 expect ( reportedErrors ) . toEqual ( [ theError ] ) ;
205197 } ) ;
206198
207- // @gate enableHalt
208199 it ( 'should be able to complete by aborting even if the promise never resolves' , async ( ) => {
209200 const errors = [ ] ;
210201 const controller = new AbortController ( ) ;
@@ -234,39 +225,6 @@ describe('ReactDOMFizzStaticNode', () => {
234225 expect ( errors ) . toEqual ( [ 'This operation was aborted' ] ) ;
235226 } ) ;
236227
237- // @gate enableHalt
238- // @gate !enableHalt
239- it ( 'should reject if aborting before the shell is complete and enableHalt is disabled' , async ( ) => {
240- const errors = [ ] ;
241- const controller = new AbortController ( ) ;
242- const promise = ReactDOMFizzStatic . prerenderToNodeStream (
243- < div >
244- < InfiniteSuspend />
245- </ div > ,
246- {
247- signal : controller . signal ,
248- onError ( x ) {
249- errors . push ( x . message ) ;
250- } ,
251- } ,
252- ) ;
253-
254- await jest . runAllTimers ( ) ;
255-
256- const theReason = new Error ( 'aborted for reasons' ) ;
257- controller . abort ( theReason ) ;
258-
259- let caughtError = null ;
260- try {
261- await promise ;
262- } catch ( error ) {
263- caughtError = error ;
264- }
265- expect ( caughtError ) . toBe ( theReason ) ;
266- expect ( errors ) . toEqual ( [ 'aborted for reasons' ] ) ;
267- } ) ;
268-
269- // @gate enableHalt
270228 it ( 'should resolve an empty shell if aborting before the shell is complete' , async ( ) => {
271229 const errors = [ ] ;
272230 const controller = new AbortController ( ) ;
@@ -300,7 +258,6 @@ describe('ReactDOMFizzStaticNode', () => {
300258 expect ( content ) . toBe ( '' ) ;
301259 } ) ;
302260
303- // @gate enableHalt
304261 it ( 'should be able to abort before something suspends' , async ( ) => {
305262 const errors = [ ] ;
306263 const controller = new AbortController ( ) ;
@@ -324,58 +281,12 @@ describe('ReactDOMFizzStaticNode', () => {
324281 } ,
325282 ) ;
326283
327- if ( gate ( flags => flags . enableHalt ) ) {
328- const { prelude} = await streamPromise ;
329- const content = await readContent ( prelude ) ;
330- expect ( errors ) . toEqual ( [ 'This operation was aborted' ] ) ;
331- expect ( content ) . toBe ( '' ) ;
332- } else {
333- let caughtError = null ;
334- try {
335- await streamPromise ;
336- } catch ( error ) {
337- caughtError = error ;
338- }
339- expect ( caughtError . message ) . toBe ( 'This operation was aborted' ) ;
340- expect ( errors ) . toEqual ( [ 'This operation was aborted' ] ) ;
341- }
342- } ) ;
343-
344- // @gate enableHalt
345- // @gate !enableHalt
346- it ( 'should reject if passing an already aborted signal and enableHalt is disabled' , async ( ) => {
347- const errors = [ ] ;
348- const controller = new AbortController ( ) ;
349- const theReason = new Error ( 'aborted for reasons' ) ;
350- controller . abort ( theReason ) ;
351-
352- const promise = ReactDOMFizzStatic . prerenderToNodeStream (
353- < div >
354- < Suspense fallback = { < div > Loading</ div > } >
355- < InfiniteSuspend />
356- </ Suspense >
357- </ div > ,
358- {
359- signal : controller . signal ,
360- onError ( x ) {
361- errors . push ( x . message ) ;
362- } ,
363- } ,
364- ) ;
365-
366- // Technically we could still continue rendering the shell but currently the
367- // semantics mean that we also abort any pending CPU work.
368- let caughtError = null ;
369- try {
370- await promise ;
371- } catch ( error ) {
372- caughtError = error ;
373- }
374- expect ( caughtError ) . toBe ( theReason ) ;
375- expect ( errors ) . toEqual ( [ 'aborted for reasons' ] ) ;
284+ const { prelude} = await streamPromise ;
285+ const content = await readContent ( prelude ) ;
286+ expect ( errors ) . toEqual ( [ 'This operation was aborted' ] ) ;
287+ expect ( content ) . toBe ( '' ) ;
376288 } ) ;
377289
378- // @gate enableHalt
379290 it ( 'should resolve with an empty prelude if passing an already aborted signal' , async ( ) => {
380291 const errors = [ ] ;
381292 const controller = new AbortController ( ) ;
@@ -412,7 +323,6 @@ describe('ReactDOMFizzStaticNode', () => {
412323 expect ( content ) . toBe ( '' ) ;
413324 } ) ;
414325
415- // @gate enableHalt
416326 it ( 'supports custom abort reasons with a string' , async ( ) => {
417327 const promise = new Promise ( r => { } ) ;
418328 function Wait ( ) {
@@ -454,7 +364,6 @@ describe('ReactDOMFizzStaticNode', () => {
454364 expect ( errors ) . toEqual ( [ 'foobar' , 'foobar' ] ) ;
455365 } ) ;
456366
457- // @gate enableHalt
458367 it ( 'supports custom abort reasons with an Error' , async ( ) => {
459368 const promise = new Promise ( r => { } ) ;
460369 function Wait ( ) {
0 commit comments