Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stable concurrent option to react-test-renderer #27804

Merged
merged 2 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ describe('ReactCache', () => {
}

ReactTestRenderer.create(<App />, {
unstable_isConcurrent: true,
isConcurrent: true,
});

await waitForAll(['Suspend! [Hi]', 'Loading...']);
Expand All @@ -141,7 +141,7 @@ describe('ReactCache', () => {
}

const root = ReactTestRenderer.create(<App />, {
unstable_isConcurrent: true,
isConcurrent: true,
});

await waitForAll(['Suspend! [Hi]', 'Loading...']);
Expand Down Expand Up @@ -181,7 +181,7 @@ describe('ReactCache', () => {
<App />
</Suspense>,
{
unstable_isConcurrent: true,
isConcurrent: true,
},
);

Expand Down Expand Up @@ -210,7 +210,7 @@ describe('ReactCache', () => {
<AsyncText ms={100} text={3} />
</Suspense>,
{
unstable_isConcurrent: true,
isConcurrent: true,
},
);
await waitForAll(['Suspend! [1]', 'Loading...']);
Expand Down Expand Up @@ -298,7 +298,7 @@ describe('ReactCache', () => {
<App />
</Suspense>,
{
unstable_isConcurrent: true,
isConcurrent: true,
},
);

Expand Down Expand Up @@ -356,7 +356,7 @@ describe('ReactCache', () => {
<BadAsyncText text="Hi" />
</Suspense>,
{
unstable_isConcurrent: true,
isConcurrent: true,
},
);

Expand All @@ -372,7 +372,7 @@ describe('ReactCache', () => {
<BadAsyncText text="Hi" />
</Suspense>,
{
unstable_isConcurrent: true,
isConcurrent: true,
},
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ describe('React hooks DevTools integration', () => {
<MyComponent />
</React.Suspense>
</div>,
{unstable_isConcurrent: true},
{isConcurrent: true},
),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('InspectedElement', () => {
// Used by inspectElementAtIndex() helper function
utils.act(() => {
testRendererInstance = TestRenderer.create(null, {
unstable_isConcurrent: true,
isConcurrent: true,
});
});

Expand Down Expand Up @@ -307,7 +307,7 @@ describe('InspectedElement', () => {
['An update to %s inside a test was not wrapped in act'],
() => {
testRendererInstance = TestRenderer.create(null, {
unstable_isConcurrent: true,
isConcurrent: true,
});
},
);
Expand Down Expand Up @@ -469,7 +469,7 @@ describe('InspectedElement', () => {
['An update to %s inside a test was not wrapped in act'],
() => {
testRendererInstance = TestRenderer.create(null, {
unstable_isConcurrent: true,
isConcurrent: true,
});
},
);
Expand Down Expand Up @@ -2034,7 +2034,7 @@ describe('InspectedElement', () => {
['An update to %s inside a test was not wrapped in act'],
() => {
testRendererInstance = TestRenderer.create(null, {
unstable_isConcurrent: true,
isConcurrent: true,
});
},
);
Expand Down Expand Up @@ -2317,7 +2317,7 @@ describe('InspectedElement', () => {
<Suspender target={id} />
</React.Suspense>
</Contexts>,
{unstable_isConcurrent: true},
{isConcurrent: true},
);
}, false);
await utils.actAsync(() => {
Expand Down Expand Up @@ -2817,7 +2817,7 @@ describe('InspectedElement', () => {
['An update to %s inside a test was not wrapped in act'],
() => {
testRendererInstance = TestRenderer.create(null, {
unstable_isConcurrent: true,
isConcurrent: true,
});
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('DebugTracing', () => {
<React.unstable_DebugTracingMode>
<div />
</React.unstable_DebugTracingMode>,
{unstable_isConcurrent: true},
{isConcurrent: true},
),
);
expect(logs).toEqual([]);
Expand Down Expand Up @@ -179,7 +179,7 @@ describe('DebugTracing', () => {
<Example />
</React.Suspense>
</React.unstable_DebugTracingMode>,
{unstable_isConcurrent: true},
{isConcurrent: true},
),
);

Expand Down Expand Up @@ -216,7 +216,7 @@ describe('DebugTracing', () => {
</React.Suspense>
</Wrapper>
</React.unstable_DebugTracingMode>,
{unstable_isConcurrent: true},
{isConcurrent: true},
),
);

Expand Down Expand Up @@ -247,7 +247,7 @@ describe('DebugTracing', () => {
<React.unstable_DebugTracingMode>
<Example />
</React.unstable_DebugTracingMode>,
{unstable_isConcurrent: true},
{isConcurrent: true},
),
);

Expand Down Expand Up @@ -278,7 +278,7 @@ describe('DebugTracing', () => {
<React.unstable_DebugTracingMode>
<Example />
</React.unstable_DebugTracingMode>,
{unstable_isConcurrent: true},
{isConcurrent: true},
),
);
}).toErrorDev('Cannot update during an existing state transition');
Expand All @@ -305,7 +305,7 @@ describe('DebugTracing', () => {
<React.unstable_DebugTracingMode>
<Example />
</React.unstable_DebugTracingMode>,
{unstable_isConcurrent: true},
{isConcurrent: true},
),
);

Expand Down Expand Up @@ -333,7 +333,7 @@ describe('DebugTracing', () => {
<React.unstable_DebugTracingMode>
<Example />
</React.unstable_DebugTracingMode>,
{unstable_isConcurrent: true},
{isConcurrent: true},
);
});
expect(logs).toEqual([
Expand All @@ -358,7 +358,7 @@ describe('DebugTracing', () => {
<React.unstable_DebugTracingMode>
<Example />
</React.unstable_DebugTracingMode>,
{unstable_isConcurrent: true},
{isConcurrent: true},
);
});

Expand All @@ -381,7 +381,7 @@ describe('DebugTracing', () => {
<React.unstable_DebugTracingMode>
<Example />
</React.unstable_DebugTracingMode>,
{unstable_isConcurrent: true},
{isConcurrent: true},
),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('ErrorBoundaryReconciliation', () => {
<ErrorBoundary fallbackTagName={fallbackTagName}>
<BrokenRender fail={false} />
</ErrorBoundary>,
{unstable_isConcurrent: isConcurrent},
{isConcurrent: isConcurrent},
);
});
expect(renderer).toMatchRenderedOutput(<span prop="BrokenRender" />);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('ReactHooks', () => {
return <Child text={text} />;
}

const root = ReactTestRenderer.create(null, {unstable_isConcurrent: true});
const root = ReactTestRenderer.create(null, {isConcurrent: true});
root.update(<Parent />);
await waitForAll(['Parent: 0, 0', 'Child: 0, 0', 'Effect: 0, 0']);
expect(root).toMatchRenderedOutput('0, 0');
Expand Down Expand Up @@ -174,7 +174,7 @@ describe('ReactHooks', () => {

Parent = memo(Parent);

const root = ReactTestRenderer.create(null, {unstable_isConcurrent: true});
const root = ReactTestRenderer.create(null, {isConcurrent: true});
root.update(<Parent theme="light" />);
await waitForAll(['Parent: 0, 0 (light)', 'Child: 0, 0 (light)']);
expect(root).toMatchRenderedOutput('0, 0 (light)');
Expand Down Expand Up @@ -232,7 +232,7 @@ describe('ReactHooks', () => {
return counter;
}

const root = ReactTestRenderer.create(null, {unstable_isConcurrent: true});
const root = ReactTestRenderer.create(null, {isConcurrent: true});
root.update(<Counter />);
await waitForAll(['Count: 0']);
expect(root).toMatchRenderedOutput('0');
Expand Down Expand Up @@ -266,7 +266,7 @@ describe('ReactHooks', () => {
return counter;
}

const root = ReactTestRenderer.create(null, {unstable_isConcurrent: true});
const root = ReactTestRenderer.create(null, {isConcurrent: true});
root.update(<Counter />);
await waitForAll(['Count: 0']);
expect(root).toMatchRenderedOutput('0');
Expand Down Expand Up @@ -322,7 +322,7 @@ describe('ReactHooks', () => {
});
return <Child text={text} />;
}
const root = ReactTestRenderer.create(null, {unstable_isConcurrent: true});
const root = ReactTestRenderer.create(null, {isConcurrent: true});
await act(() => {
root.update(
<ThemeProvider>
Expand Down Expand Up @@ -390,7 +390,7 @@ describe('ReactHooks', () => {
return <Child text={counter} />;
}

const root = ReactTestRenderer.create(null, {unstable_isConcurrent: true});
const root = ReactTestRenderer.create(null, {isConcurrent: true});
root.update(<Parent />);
await waitForAll(['Parent: 0', 'Child: 0', 'Effect: 0']);
expect(root).toMatchRenderedOutput('0');
Expand Down Expand Up @@ -465,7 +465,7 @@ describe('ReactHooks', () => {
return <Child text={counter} />;
}

const root = ReactTestRenderer.create(null, {unstable_isConcurrent: true});
const root = ReactTestRenderer.create(null, {isConcurrent: true});
root.update(<Parent />);
await waitForAll(['Parent: 0', 'Child: 0']);
expect(root).toMatchRenderedOutput('0');
Expand Down Expand Up @@ -523,7 +523,7 @@ describe('ReactHooks', () => {
return <Child text={counter} />;
}

const root = ReactTestRenderer.create(null, {unstable_isConcurrent: true});
const root = ReactTestRenderer.create(null, {isConcurrent: true});
root.update(<Parent />);
await waitForAll(['Parent: 1', 'Child: 1']);
expect(root).toMatchRenderedOutput('1');
Expand Down
Loading