@@ -1377,26 +1377,14 @@ describe('ReactFlight', () => {
13771377 errors : [
13781378 {
13791379 message : 'This is an error' ,
1380- stack : gate (
1381- flags =>
1382- flags . enableOwnerStacks || flags . enableServerComponentLogs ,
1383- )
1384- ? expect . stringContaining (
1385- 'Error: This is an error\n' +
1386- ' at eval (eval at testFunction (inspected-page.html:29:11),%20%3Canonymous%3E:1:35)\n' +
1387- ' at ServerComponentError (file://~/(some)(really)(exotic-directory)/ReactFlight-test.js:1166:19)\n' +
1388- ' at <anonymous> (file:///testing.js:42:3)\n' +
1389- ' at <anonymous> (file:///testing.js:42:3)\n' +
1390- ' at div (<anonymous>' ,
1391- )
1392- : expect . stringContaining (
1393- 'Error: This is an error\n' +
1394- ' at eval (eval at testFunction (inspected-page.html:29:11),%20%3Canonymous%3E:1:10)\n' +
1395- ' at ServerComponentError (file://~/(some)(really)(exotic-directory)/ReactFlight-test.js:1166:19)\n' +
1396- ' at file:///testing.js:42:3\n' +
1397- ' at file:///testing.js:42:3\n' +
1398- ' at div (<anonymous>' ,
1399- ) ,
1380+ stack : expect . stringContaining (
1381+ 'Error: This is an error\n' +
1382+ ' at eval (eval at testFunction (inspected-page.html:29:11),%20%3Canonymous%3E:1:35)\n' +
1383+ ' at ServerComponentError (file://~/(some)(really)(exotic-directory)/ReactFlight-test.js:1166:19)\n' +
1384+ ' at <anonymous> (file:///testing.js:42:3)\n' +
1385+ ' at <anonymous> (file:///testing.js:42:3)\n' +
1386+ ' at div (<anonymous>' ,
1387+ ) ,
14001388 digest : 'a dev digest' ,
14011389 environmentName : 'Server' ,
14021390 } ,
@@ -1415,18 +1403,16 @@ describe('ReactFlight', () => {
14151403 [ '' , 'Server' ] ,
14161404 [ __filename , 'Server' ] ,
14171405 ]
1418- : gate ( flags => flags . enableServerComponentLogs )
1419- ? [
1420- // TODO: What should we request here? The outer (<anonymous>) or the inner (inspected-page.html)?
1421- [ 'inspected-page.html:29:11), <anonymous>' , 'Server' ] ,
1422- [
1423- 'file://~/(some)(really)(exotic-directory)/ReactFlight-test.js' ,
1424- 'Server' ,
1425- ] ,
1426- [ 'file:///testing.js' , 'Server' ] ,
1427- [ '' , 'Server' ] ,
1428- ]
1429- : [ ] ,
1406+ : [
1407+ // TODO: What should we request here? The outer (<anonymous>) or the inner (inspected-page.html)?
1408+ [ 'inspected-page.html:29:11), <anonymous>' , 'Server' ] ,
1409+ [
1410+ 'file://~/(some)(really)(exotic-directory)/ReactFlight-test.js' ,
1411+ 'Server' ,
1412+ ] ,
1413+ [ 'file:///testing.js' , 'Server' ] ,
1414+ [ '' , 'Server' ] ,
1415+ ] ,
14301416 } ) ;
14311417 } else {
14321418 expect ( errors . map ( getErrorForJestMatcher ) ) . toEqual ( [
@@ -3312,14 +3298,7 @@ describe('ReactFlight', () => {
33123298 . split ( '\n' )
33133299 . slice ( 0 , 4 )
33143300 . join ( '\n' )
3315- . replaceAll (
3316- ' (/' ,
3317- gate (
3318- flags => flags . enableOwnerStacks || flags . enableServerComponentLogs ,
3319- )
3320- ? ' (file:///'
3321- : ' (/' ,
3322- ) ; // The eval will end up normalizing these
3301+ . replaceAll ( ' (/' , ' (file:///' ) ; // The eval will end up normalizing these
33233302
33243303 let sawReactPrefix = false ;
33253304 const environments = [ ] ;
@@ -3352,7 +3331,7 @@ describe('ReactFlight', () => {
33523331 'third-party' ,
33533332 'third-party' ,
33543333 ] ) ;
3355- } else if ( __DEV__ && gate ( flags => flags . enableServerComponentLogs ) ) {
3334+ } else if ( __DEV__ ) {
33563335 expect ( environments . slice ( 0 , 3 ) ) . toEqual ( [
33573336 'third-party' ,
33583337 'third-party' ,
@@ -3412,7 +3391,7 @@ describe('ReactFlight', () => {
34123391 expect ( ReactNoop ) . toMatchRenderedOutput ( < div > hi</ div > ) ;
34133392 } ) ;
34143393
3415- // @gate enableServerComponentLogs && __DEV__ && enableOwnerStacks
3394+ // @gate __DEV__ && enableOwnerStacks
34163395 it ( 'replays logs, but not onError logs' , async ( ) => {
34173396 function foo ( ) {
34183397 return 'hello' ;
@@ -3493,7 +3472,7 @@ describe('ReactFlight', () => {
34933472 expect ( ownerStacks ) . toEqual ( [ '\n in App (at **)' ] ) ;
34943473 } ) ;
34953474
3496- // @gate enableServerComponentLogs && __DEV__
3475+ // @gate __DEV__
34973476 it ( 'replays logs with cyclic objects' , async ( ) => {
34983477 const cyclic = { cycle : null } ;
34993478 cyclic . cycle = cyclic ;
@@ -3764,7 +3743,7 @@ describe('ReactFlight', () => {
37643743 ) ;
37653744 } ) ;
37663745
3767- // @gate (enableOwnerStacks && enableServerComponentLogs ) || !__DEV__
3746+ // @gate (enableOwnerStacks) || !__DEV__
37683747 it ( 'should include only one component stack in replayed logs (if DevTools or polyfill adds them)' , ( ) => {
37693748 class MyError extends Error {
37703749 toJSON ( ) {
0 commit comments