@@ -1400,6 +1400,7 @@ describe('Profiler', () => { |
1400 | 1400 |
|
1401 | 1401 | const ComponentWithEffects = ({shouldCascade}) => { |
1402 | 1402 | const [didCascade, setDidCascade] = React.useState(false); |
| 1403 | + Scheduler.unstable_advanceTime(100000000); |
1403 | 1404 | React.useLayoutEffect(() => { |
1404 | 1405 | if (shouldCascade && !didCascade) { |
1405 | 1406 | setDidCascade(true); |
@@ -1426,6 +1427,7 @@ describe('Profiler', () => { |
1426 | 1427 | } |
1427 | 1428 | } |
1428 | 1429 | render() { |
| 1430 | + Scheduler.unstable_advanceTime(1000000000); |
1429 | 1431 | return null; |
1430 | 1432 | } |
1431 | 1433 | } |
@@ -1447,7 +1449,7 @@ describe('Profiler', () => { |
1447 | 1449 | expect(call[0]).toBe('mount-test'); |
1448 | 1450 | expect(call[1]).toBe('mount'); |
1449 | 1451 | expect(call[2]).toBe(1010); // durations |
1450 | | - expect(call[3]).toBe(1); // commit start time (before mutations or effects) |
| 1452 | + expect(call[3]).toBe(1100000001); // commit start time (before mutations or effects) |
1451 | 1453 | expect(call[4]).toEqual(enableSchedulerTracing ? new Set() : undefined); // interaction events |
1452 | 1454 |
|
1453 | 1455 | call = callback.mock.calls[1]; |
@@ -1456,7 +1458,7 @@ describe('Profiler', () => { |
1456 | 1458 | expect(call[0]).toBe('mount-test'); |
1457 | 1459 | expect(call[1]).toBe('update'); |
1458 | 1460 | expect(call[2]).toBe(130); // durations |
1459 | | - expect(call[3]).toBe(1011); // commit start time (before mutations or effects) |
| 1461 | + expect(call[3]).toBe(1200001011); // commit start time (before mutations or effects) |
1460 | 1462 | expect(call[4]).toEqual(enableSchedulerTracing ? new Set() : undefined); // interaction events |
1461 | 1463 |
|
1462 | 1464 | Scheduler.unstable_advanceTime(1); |
@@ -1476,7 +1478,7 @@ describe('Profiler', () => { |
1476 | 1478 | expect(call[0]).toBe('update-test'); |
1477 | 1479 | expect(call[1]).toBe('update'); |
1478 | 1480 | expect(call[2]).toBe(10130); // durations |
1479 | | - expect(call[3]).toBe(1142); // commit start time (before mutations or effects) |
| 1481 | + expect(call[3]).toBe(2300001142); // commit start time (before mutations or effects) |
1480 | 1482 | expect(call[4]).toEqual(enableSchedulerTracing ? new Set() : undefined); // interaction events |
1481 | 1483 |
|
1482 | 1484 | call = callback.mock.calls[3]; |
@@ -1485,7 +1487,7 @@ describe('Profiler', () => { |
1485 | 1487 | expect(call[0]).toBe('update-test'); |
1486 | 1488 | expect(call[1]).toBe('update'); |
1487 | 1489 | expect(call[2]).toBe(10000); // durations |
1488 | | - expect(call[3]).toBe(11272); // commit start time (before mutations or effects) |
| 1490 | + expect(call[3]).toBe(3300011272); // commit start time (before mutations or effects) |
1489 | 1491 | expect(call[4]).toEqual(enableSchedulerTracing ? new Set() : undefined); // interaction events |
1490 | 1492 | }); |
1491 | 1493 |
|
@@ -1966,6 +1968,7 @@ describe('Profiler', () => { |
1966 | 1968 |
|
1967 | 1969 | const ComponentWithEffects = () => { |
1968 | 1970 | const [didMount, setDidMount] = React.useState(false); |
| 1971 | + Scheduler.unstable_advanceTime(1000); |
1969 | 1972 | React.useEffect(() => { |
1970 | 1973 | if (!didMount) { |
1971 | 1974 | setDidMount(true); |
@@ -1996,7 +1999,7 @@ describe('Profiler', () => { |
1996 | 1999 | expect(call[0]).toBe('mount-test'); |
1997 | 2000 | expect(call[1]).toBe('mount'); |
1998 | 2001 | expect(call[2]).toBe(10); // durations |
1999 | | - expect(call[3]).toBe(1); // commit start time (before mutations or effects) |
| 2002 | + expect(call[3]).toBe(1001); // commit start time (before mutations or effects) |
2000 | 2003 | expect(call[4]).toEqual(enableSchedulerTracing ? new Set() : undefined); // interaction events |
2001 | 2004 |
|
2002 | 2005 | call = callback.mock.calls[1]; |
@@ -2005,7 +2008,7 @@ describe('Profiler', () => { |
2005 | 2008 | expect(call[0]).toBe('mount-test'); |
2006 | 2009 | expect(call[1]).toBe('update'); |
2007 | 2010 | expect(call[2]).toBe(130); // durations |
2008 | | - expect(call[3]).toBe(11); // commit start time (before mutations or effects) |
| 2011 | + expect(call[3]).toBe(2011); // commit start time (before mutations or effects) |
2009 | 2012 | expect(call[4]).toEqual(enableSchedulerTracing ? new Set() : undefined); // interaction events |
2010 | 2013 | }); |
2011 | 2014 |
|
|