Skip to content

Commit 83199cb

Browse files
author
Brian Vaughn
committed
Enabled DebugTracing flag for variant tests
And fix a few tests that had gotten stale.
1 parent 5427b46 commit 83199cb

2 files changed

Lines changed: 36 additions & 13 deletions

File tree

packages/react-reconciler/src/__tests__/DebugTracing-test.internal.js

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,23 @@ describe('DebugTracing', () => {
191191
expect(Scheduler).toFlushUntilNextPaint([]);
192192
}).toErrorDev('Cannot update during an existing state transition');
193193

194-
expect(logs).toEqual([
195-
'group: ⚛️ render (0b0000000000000000000001000000000)',
196-
'log: ⚛️ Example updated state (0b0000000000000000000010000000000)',
197-
'log: ⚛️ Example updated state (0b0000000000000000000010000000000)',
198-
'groupEnd: ⚛️ render (0b0000000000000000000001000000000)',
199-
]);
194+
gate(flags => {
195+
if (flags.new) {
196+
expect(logs).toEqual([
197+
'group: ⚛️ render (0b0000000000000000000001000000000)',
198+
'log: ⚛️ Example updated state (0b0000000000000000000001000000000)',
199+
'log: ⚛️ Example updated state (0b0000000000000000000001000000000)',
200+
'groupEnd: ⚛️ render (0b0000000000000000000001000000000)',
201+
]);
202+
} else {
203+
expect(logs).toEqual([
204+
'group: ⚛️ render (0b0000000000000000000001000000000)',
205+
'log: ⚛️ Example updated state (0b0000000000000000000010000000000)',
206+
'log: ⚛️ Example updated state (0b0000000000000000000010000000000)',
207+
'groupEnd: ⚛️ render (0b0000000000000000000001000000000)',
208+
]);
209+
}
210+
});
200211
});
201212

202213
// @gate experimental && build === 'development' && enableDebugTracing
@@ -274,12 +285,24 @@ describe('DebugTracing', () => {
274285
{unstable_isConcurrent: true},
275286
);
276287
});
277-
expect(logs).toEqual([
278-
'group: ⚛️ render (0b0000000000000000000001000000000)',
279-
'log: ⚛️ Example updated state (0b0000000000000000000010000000000)',
280-
'log: ⚛️ Example updated state (0b0000000000000000000010000000000)', // debugRenderPhaseSideEffectsForStrictMode
281-
'groupEnd: ⚛️ render (0b0000000000000000000001000000000)',
282-
]);
288+
289+
gate(flags => {
290+
if (flags.new) {
291+
expect(logs).toEqual([
292+
'group: ⚛️ render (0b0000000000000000000001000000000)',
293+
'log: ⚛️ Example updated state (0b0000000000000000000001000000000)',
294+
'log: ⚛️ Example updated state (0b0000000000000000000001000000000)', // debugRenderPhaseSideEffectsForStrictMode
295+
'groupEnd: ⚛️ render (0b0000000000000000000001000000000)',
296+
]);
297+
} else {
298+
expect(logs).toEqual([
299+
'group: ⚛️ render (0b0000000000000000000001000000000)',
300+
'log: ⚛️ Example updated state (0b0000000000000000000010000000000)',
301+
'log: ⚛️ Example updated state (0b0000000000000000000010000000000)', // debugRenderPhaseSideEffectsForStrictMode
302+
'groupEnd: ⚛️ render (0b0000000000000000000001000000000)',
303+
]);
304+
}
305+
});
283306
});
284307

285308
// @gate experimental && build === 'development' && enableDebugTracing

packages/shared/forks/ReactFeatureFlags.www-dynamic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const enableEagerRootListeners = !__VARIANT__;
2525
// It logs information to the console about React scheduling, rendering, and commit phases.
2626
//
2727
// NOTE: This feature will only work in DEV mode; all callsights are wrapped with __DEV__.
28-
export const enableDebugTracing = false;
28+
export const enableDebugTracing = __EXPERIMENTAL__;
2929

3030
// This only has an effect in the new reconciler. But also, the new reconciler
3131
// is only enabled when __VARIANT__ is true. So this is set to the opposite of

0 commit comments

Comments
 (0)