diff --git a/packages/react-devtools-shared/src/__tests__/profilingCharts-test.js b/packages/react-devtools-shared/src/__tests__/profilingCharts-test.js
index d59d616d67e61..41d9093feeb54 100644
--- a/packages/react-devtools-shared/src/__tests__/profilingCharts-test.js
+++ b/packages/react-devtools-shared/src/__tests__/profilingCharts-test.js
@@ -9,10 +9,11 @@
import type Store from 'react-devtools-shared/src/devtools/store';
+import {getVersionedRenderImplementation} from './utils';
+
describe('profiling charts', () => {
let React;
let Scheduler;
- let legacyRender;
let store: Store;
let utils;
@@ -20,8 +21,6 @@ describe('profiling charts', () => {
utils = require('./utils');
utils.beforeEachProfiling();
- legacyRender = utils.legacyRender;
-
store = global.store;
store.collapseNodesByDefault = false;
store.recordChangeDescriptions = true;
@@ -30,6 +29,8 @@ describe('profiling charts', () => {
Scheduler = require('scheduler');
});
+ const {render} = getVersionedRenderImplementation();
+
function getFlamegraphChartData(rootID, commitIndex) {
const commitTree = store.profilerStore.profilingCache.getCommitTree({
commitIndex,
@@ -78,11 +79,9 @@ describe('profiling charts', () => {
return null;
});
- const container = document.createElement('div');
-
utils.act(() => store.profilerStore.startProfiling());
- utils.act(() => legacyRender(, container));
+ utils.act(() => render());
expect(store).toMatchInlineSnapshot(`
[root]
▾
@@ -91,7 +90,7 @@ describe('profiling charts', () => {
[Memo]
`);
- utils.act(() => legacyRender(, container));
+ utils.act(() => render());
expect(store).toMatchInlineSnapshot(`
[root]
▾
@@ -228,11 +227,9 @@ describe('profiling charts', () => {
return null;
});
- const container = document.createElement('div');
-
utils.act(() => store.profilerStore.startProfiling());
- utils.act(() => legacyRender(, container));
+ utils.act(() => render());
expect(store).toMatchInlineSnapshot(`
[root]
▾
@@ -241,7 +238,7 @@ describe('profiling charts', () => {
[Memo]
`);
- utils.act(() => legacyRender(, container));
+ utils.act(() => render());
expect(store).toMatchInlineSnapshot(`
[root]
▾