Skip to content

Commit

Permalink
refactor: remove unused code (#540)
Browse files Browse the repository at this point in the history
refactor: remove unused late render detection in measure render
  • Loading branch information
mdjastrzebski authored Oct 28, 2024
1 parent 20f5746 commit d69abb3
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions packages/measure/src/measure-renders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,12 @@ async function measureRendersInternal(
applyRenderPolyfills();

const runResults: RunResult[] = [];
let hasTooLateRender = false;

const renderJsonTrees: ElementJsonTree[] = [];
let initialRenderCount = 0;

for (let iteration = 0; iteration < runs + warmupRuns; iteration += 1) {
let duration = 0;
let count = 0;
let isFinished = false;

let renderResult: any = null;

const captureRenderDetails = () => {
Expand All @@ -96,10 +92,6 @@ async function measureRendersInternal(
duration += actualDuration;
count += 1;

if (isFinished) {
hasTooLateRender = true;
}

captureRenderDetails();
};

Expand All @@ -112,20 +104,11 @@ async function measureRendersInternal(
}

cleanup();

isFinished = true;
global.gc?.();

runResults.push({ duration, count });
}

if (hasTooLateRender) {
const testName = expect.getState().currentTestName;
logger.warn(
`test "${testName}" still re-renders after test scenario finished.\n\nPlease update your code to wait for all renders to finish.`
);
}

revertRenderPolyfills();

return {
Expand Down

0 comments on commit d69abb3

Please sign in to comment.