@@ -16,6 +16,9 @@ describe('DebugTracing', () => {
16
16
17
17
let logs ;
18
18
19
+ const DEFAULT_LANE_STRING = '0b0000000000000000000000010000000' ;
20
+ const RETRY_LANE_STRING = '0b0000000100000000000000000000000' ;
21
+
19
22
beforeEach ( ( ) => {
20
23
jest . resetModules ( ) ;
21
24
@@ -129,9 +132,9 @@ describe('DebugTracing', () => {
129
132
expect ( Scheduler ) . toFlushUntilNextPaint ( [ ] ) ;
130
133
131
134
expect ( logs ) . toEqual ( [
132
- ' group: ⚛️ render (0b0000000010000000000000000000000)' ,
135
+ ` group: ⚛️ render (${ RETRY_LANE_STRING } )` ,
133
136
'log: <Example/>' ,
134
- ' groupEnd: ⚛️ render (0b0000000010000000000000000000000)' ,
137
+ ` groupEnd: ⚛️ render (${ RETRY_LANE_STRING } )` ,
135
138
] ) ;
136
139
} ) ;
137
140
@@ -158,9 +161,9 @@ describe('DebugTracing', () => {
158
161
expect ( Scheduler ) . toFlushUntilNextPaint ( [ ] ) ;
159
162
160
163
expect ( logs ) . toEqual ( [
161
- ' group: ⚛️ render (0b0000000000000000000001000000000)' ,
164
+ ` group: ⚛️ render (${ DEFAULT_LANE_STRING } )` ,
162
165
'log: ⚛️ Example suspended' ,
163
- ' groupEnd: ⚛️ render (0b0000000000000000000001000000000)' ,
166
+ ` groupEnd: ⚛️ render (${ DEFAULT_LANE_STRING } )` ,
164
167
] ) ;
165
168
166
169
logs . splice ( 0 ) ;
@@ -199,19 +202,19 @@ describe('DebugTracing', () => {
199
202
expect ( Scheduler ) . toFlushUntilNextPaint ( [ ] ) ;
200
203
201
204
expect ( logs ) . toEqual ( [
202
- ' group: ⚛️ render (0b0000000000000000000001000000000)' ,
205
+ ` group: ⚛️ render (${ DEFAULT_LANE_STRING } )` ,
203
206
'log: <Wrapper/>' ,
204
- ' groupEnd: ⚛️ render (0b0000000000000000000001000000000)' ,
207
+ ` groupEnd: ⚛️ render (${ DEFAULT_LANE_STRING } )` ,
205
208
] ) ;
206
209
207
210
logs . splice ( 0 ) ;
208
211
209
212
expect ( Scheduler ) . toFlushUntilNextPaint ( [ ] ) ;
210
213
211
214
expect ( logs ) . toEqual ( [
212
- ' group: ⚛️ render (0b0000000010000000000000000000000)' ,
215
+ ` group: ⚛️ render (${ RETRY_LANE_STRING } )` ,
213
216
'log: <Example/>' ,
214
- ' groupEnd: ⚛️ render (0b0000000010000000000000000000000)' ,
217
+ ` groupEnd: ⚛️ render (${ RETRY_LANE_STRING } )` ,
215
218
] ) ;
216
219
} ) ;
217
220
@@ -241,11 +244,11 @@ describe('DebugTracing', () => {
241
244
expect ( Scheduler ) . toFlushUntilNextPaint ( [ ] ) ;
242
245
243
246
expect ( logs ) . toEqual ( [
244
- ' group: ⚛️ commit (0b0000000000000000000001000000000)' ,
245
- ' group: ⚛️ layout effects (0b0000000000000000000001000000000)' ,
247
+ ` group: ⚛️ commit (${ DEFAULT_LANE_STRING } )` ,
248
+ ` group: ⚛️ layout effects (${ DEFAULT_LANE_STRING } )` ,
246
249
'log: ⚛️ Example updated state (0b0000000000000000000000000000001)' ,
247
- ' groupEnd: ⚛️ layout effects (0b0000000000000000000001000000000)' ,
248
- ' groupEnd: ⚛️ commit (0b0000000000000000000001000000000)' ,
250
+ ` groupEnd: ⚛️ layout effects (${ DEFAULT_LANE_STRING } )` ,
251
+ ` groupEnd: ⚛️ commit (${ DEFAULT_LANE_STRING } )` ,
249
252
] ) ;
250
253
} ) ;
251
254
@@ -277,10 +280,10 @@ describe('DebugTracing', () => {
277
280
} ) . toErrorDev ( 'Cannot update during an existing state transition' ) ;
278
281
279
282
expect ( logs ) . toEqual ( [
280
- ' group: ⚛️ render (0b0000000000000000000001000000000)' ,
281
- ' log: ⚛️ Example updated state (0b0000000000000000000001000000000)' ,
282
- ' log: ⚛️ Example updated state (0b0000000000000000000001000000000)' ,
283
- ' groupEnd: ⚛️ render (0b0000000000000000000001000000000)' ,
283
+ ` group: ⚛️ render (${ DEFAULT_LANE_STRING } )` ,
284
+ ` log: ⚛️ Example updated state (${ DEFAULT_LANE_STRING } )` ,
285
+ ` log: ⚛️ Example updated state (${ DEFAULT_LANE_STRING } )` ,
286
+ ` groupEnd: ⚛️ render (${ DEFAULT_LANE_STRING } )` ,
284
287
] ) ;
285
288
} ) ;
286
289
@@ -308,11 +311,11 @@ describe('DebugTracing', () => {
308
311
expect ( Scheduler ) . toFlushUntilNextPaint ( [ ] ) ;
309
312
310
313
expect ( logs ) . toEqual ( [
311
- ' group: ⚛️ commit (0b0000000000000000000001000000000)' ,
312
- ' group: ⚛️ layout effects (0b0000000000000000000001000000000)' ,
314
+ ` group: ⚛️ commit (${ DEFAULT_LANE_STRING } )` ,
315
+ ` group: ⚛️ layout effects (${ DEFAULT_LANE_STRING } )` ,
313
316
'log: ⚛️ Example updated state (0b0000000000000000000000000000001)' ,
314
- ' groupEnd: ⚛️ layout effects (0b0000000000000000000001000000000)' ,
315
- ' groupEnd: ⚛️ commit (0b0000000000000000000001000000000)' ,
317
+ ` groupEnd: ⚛️ layout effects (${ DEFAULT_LANE_STRING } )` ,
318
+ ` groupEnd: ⚛️ commit (${ DEFAULT_LANE_STRING } )` ,
316
319
] ) ;
317
320
} ) ;
318
321
@@ -335,9 +338,9 @@ describe('DebugTracing', () => {
335
338
) ;
336
339
} ) ;
337
340
expect ( logs ) . toEqual ( [
338
- ' group: ⚛️ passive effects (0b0000000000000000000001000000000)' ,
339
- ' log: ⚛️ Example updated state (0b0000000000000000000001000000000)' ,
340
- ' groupEnd: ⚛️ passive effects (0b0000000000000000000001000000000)' ,
341
+ ` group: ⚛️ passive effects (${ DEFAULT_LANE_STRING } )` ,
342
+ ` log: ⚛️ Example updated state (${ DEFAULT_LANE_STRING } )` ,
343
+ ` groupEnd: ⚛️ passive effects (${ DEFAULT_LANE_STRING } )` ,
341
344
] ) ;
342
345
} ) ;
343
346
@@ -361,10 +364,10 @@ describe('DebugTracing', () => {
361
364
} ) ;
362
365
363
366
expect ( logs ) . toEqual ( [
364
- ' group: ⚛️ render (0b0000000000000000000001000000000)' ,
365
- ' log: ⚛️ Example updated state (0b0000000000000000000001000000000)' ,
366
- ' log: ⚛️ Example updated state (0b0000000000000000000001000000000)' , // debugRenderPhaseSideEffectsForStrictMode
367
- ' groupEnd: ⚛️ render (0b0000000000000000000001000000000)' ,
367
+ ` group: ⚛️ render (${ DEFAULT_LANE_STRING } )` ,
368
+ ` log: ⚛️ Example updated state (${ DEFAULT_LANE_STRING } )` ,
369
+ ` log: ⚛️ Example updated state (${ DEFAULT_LANE_STRING } )` , // debugRenderPhaseSideEffectsForStrictMode
370
+ ` groupEnd: ⚛️ render (${ DEFAULT_LANE_STRING } )` ,
368
371
] ) ;
369
372
} ) ;
370
373
@@ -389,9 +392,9 @@ describe('DebugTracing', () => {
389
392
expect ( Scheduler ) . toFlushUntilNextPaint ( [ ] ) ;
390
393
391
394
expect ( logs ) . toEqual ( [
392
- ' group: ⚛️ render (0b0000000000000000000001000000000)' ,
395
+ ` group: ⚛️ render (${ DEFAULT_LANE_STRING } )` ,
393
396
'log: Hello from user code' ,
394
- ' groupEnd: ⚛️ render (0b0000000000000000000001000000000)' ,
397
+ ` groupEnd: ⚛️ render (${ DEFAULT_LANE_STRING } )` ,
395
398
] ) ;
396
399
} ) ;
397
400
0 commit comments