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

chore: use versioned render in profilerChangeDescriptions test #28221

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,26 @@
* @flow
*/

import {getVersionedRenderImplementation} from './utils';

describe('Profiler change descriptions', () => {
let React;
let legacyRender;
let store;
let utils;

beforeEach(() => {
utils = require('./utils');
utils.beforeEachProfiling();

legacyRender = utils.legacyRender;

store = global.store;
store.collapseNodesByDefault = false;
store.recordChangeDescriptions = true;

React = require('react');
});

const {render} = getVersionedRenderImplementation();

// @reactVersion >=18.0
it('should identify useContext as the cause for a re-render', () => {
const Context = React.createContext(0);
Expand Down Expand Up @@ -62,10 +63,8 @@ describe('Profiler change descriptions', () => {
);
};

const container = document.createElement('div');

utils.act(() => store.profilerStore.startProfiling());
utils.act(() => legacyRender(<App />, container));
utils.act(() => render(<App />));
utils.act(() => forceUpdate());
utils.act(() => store.profilerStore.stopProfiling());

Expand Down