@@ -1377,26 +1377,14 @@ describe('ReactFlight', () => {
1377
1377
errors : [
1378
1378
{
1379
1379
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
+ ) ,
1400
1388
digest : 'a dev digest' ,
1401
1389
environmentName : 'Server' ,
1402
1390
} ,
@@ -1415,18 +1403,16 @@ describe('ReactFlight', () => {
1415
1403
[ '' , 'Server' ] ,
1416
1404
[ __filename , 'Server' ] ,
1417
1405
]
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
+ ] ,
1430
1416
} ) ;
1431
1417
} else {
1432
1418
expect ( errors . map ( getErrorForJestMatcher ) ) . toEqual ( [
@@ -3312,14 +3298,7 @@ describe('ReactFlight', () => {
3312
3298
. split ( '\n' )
3313
3299
. slice ( 0 , 4 )
3314
3300
. 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
3323
3302
3324
3303
let sawReactPrefix = false ;
3325
3304
const environments = [ ] ;
@@ -3352,7 +3331,7 @@ describe('ReactFlight', () => {
3352
3331
'third-party' ,
3353
3332
'third-party' ,
3354
3333
] ) ;
3355
- } else if ( __DEV__ && gate ( flags => flags . enableServerComponentLogs ) ) {
3334
+ } else if ( __DEV__ ) {
3356
3335
expect ( environments . slice ( 0 , 3 ) ) . toEqual ( [
3357
3336
'third-party' ,
3358
3337
'third-party' ,
@@ -3412,7 +3391,7 @@ describe('ReactFlight', () => {
3412
3391
expect ( ReactNoop ) . toMatchRenderedOutput ( < div > hi</ div > ) ;
3413
3392
} ) ;
3414
3393
3415
- // @gate enableServerComponentLogs && __DEV__ && enableOwnerStacks
3394
+ // @gate __DEV__ && enableOwnerStacks
3416
3395
it ( 'replays logs, but not onError logs' , async ( ) => {
3417
3396
function foo ( ) {
3418
3397
return 'hello' ;
@@ -3493,7 +3472,7 @@ describe('ReactFlight', () => {
3493
3472
expect ( ownerStacks ) . toEqual ( [ '\n in App (at **)' ] ) ;
3494
3473
} ) ;
3495
3474
3496
- // @gate enableServerComponentLogs && __DEV__
3475
+ // @gate __DEV__
3497
3476
it ( 'replays logs with cyclic objects' , async ( ) => {
3498
3477
const cyclic = { cycle : null } ;
3499
3478
cyclic . cycle = cyclic ;
@@ -3764,7 +3743,7 @@ describe('ReactFlight', () => {
3764
3743
) ;
3765
3744
} ) ;
3766
3745
3767
- // @gate (enableOwnerStacks && enableServerComponentLogs ) || !__DEV__
3746
+ // @gate (enableOwnerStacks) || !__DEV__
3768
3747
it ( 'should include only one component stack in replayed logs (if DevTools or polyfill adds them)' , ( ) => {
3769
3748
class MyError extends Error {
3770
3749
toJSON ( ) {
0 commit comments