Skip to content

Commit d3bc7a2

Browse files
committed
Fix tests
1 parent f708808 commit d3bc7a2

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

packages/react-reconciler/src/__tests__/ReactExpiration-test.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,20 +127,20 @@ describe('ReactExpiration', () => {
127127
it('increases priority of updates as time progresses', async () => {
128128
if (gate(flags => flags.forceConcurrentByDefaultForTesting)) {
129129
// TODO: How does this pass on main?
130-
// ReactNoop.render(<span prop="done" />);
131-
// expect(ReactNoop).toMatchRenderedOutput(null);
132-
//
133-
// // Nothing has expired yet because time hasn't advanced.
134-
// flushNextRenderIfExpired();
135-
// expect(ReactNoop).toMatchRenderedOutput(null);
136-
// // Advance time a bit, but not enough to expire the low pri update.
137-
// ReactNoop.expire(4500);
138-
// flushNextRenderIfExpired();
139-
// expect(ReactNoop).toMatchRenderedOutput(null);
140-
// // Advance by another second. Now the update should expire and flush.
141-
// ReactNoop.expire(500);
142-
// flushNextRenderIfExpired();
143-
// expect(ReactNoop).toMatchRenderedOutput(<span prop="done" />);
130+
ReactNoop.render(<span prop="done" />);
131+
expect(ReactNoop).toMatchRenderedOutput(null);
132+
133+
// Nothing has expired yet because time hasn't advanced.
134+
flushNextRenderIfExpired();
135+
expect(ReactNoop).toMatchRenderedOutput(null);
136+
// Advance time a bit, but not enough to expire the low pri update.
137+
ReactNoop.expire(4500);
138+
flushNextRenderIfExpired();
139+
expect(ReactNoop).toMatchRenderedOutput(null);
140+
// Advance by another second. Now the update should expire and flush.
141+
ReactNoop.expire(500);
142+
flushNextRenderIfExpired();
143+
expect(ReactNoop).toMatchRenderedOutput(<span prop="done" />);
144144
} else {
145145
ReactNoop.render(<Text text="Step 1" />);
146146
React.startTransition(() => {

scripts/jest/setupTests.www.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jest.mock('shared/ReactFeatureFlags', () => {
99
const actual = jest.requireActual('shared/forks/ReactFeatureFlags.www');
1010

1111
// This flag is only used by tests, it should never be set elsewhere.
12-
actual.forceConcurrentByDefaultForTesting = __VARIANT__;
12+
actual.forceConcurrentByDefaultForTesting = !__VARIANT__;
1313

1414
return actual;
1515
});

0 commit comments

Comments
 (0)