Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
endTest() {
const measurements = Perf.getLastMeasurements();
const wasted = Perf.getWasted(measurements);
const summary = {};
summary.hasWastedTime = component => {
const result = find(wasted, n => n.key.indexOf(`> ${component}`));
if (result) {
return (
`${result.key} wasted ${result.inclusiveRenderDuration}ms ` +
`across ${result.renderCount} renders`
);
}
return false;
};
return this.props.onComplete(summary);
}