From fc8bbcaf30536aab60c793bb840f06f9a47d00f5 Mon Sep 17 00:00:00 2001 From: Marin Atanasov Date: Thu, 9 Jun 2022 17:07:35 +0300 Subject: [PATCH] Lodash: Refactor away from _.sum() --- packages/e2e-tests/specs/performance/post-editor.test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/e2e-tests/specs/performance/post-editor.test.js b/packages/e2e-tests/specs/performance/post-editor.test.js index 54689fff5e5f12..5fa46c71bf62c7 100644 --- a/packages/e2e-tests/specs/performance/post-editor.test.js +++ b/packages/e2e-tests/specs/performance/post-editor.test.js @@ -3,7 +3,6 @@ */ import { basename, join } from 'path'; import { writeFileSync } from 'fs'; -import { sum } from 'lodash'; /** * WordPress dependencies @@ -226,6 +225,10 @@ describe( 'Post Editor Performance', () => { } ); it( 'Searching the inserter', async () => { + function sum( arr ) { + return arr.reduce( ( a, b ) => a + b, 0 ); + } + // Measure time to search the inserter and get results. await openGlobalBlockInserter(); for ( let j = 0; j < 10; j++ ) {