diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index 390f71d085b1..a3952f027c7d 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -7,6 +7,10 @@ _Released 6/4/2024 (PENDING)_ - Added support for [Next.js 14](https://nextjs.org/blog/next-14) for component testing. Addresses [#28185](https://github.com/cypress-io/cypress/issues/28185). +**Performance:** + +- Improved performance when setting console props within `Cypress.log`. Addressed in [#29501](https://github.com/cypress-io/cypress/pull/29501). + **Bugfixes:** - Pre-emptively fix behavior with Chrome for when `unload` events are forcefully deprecated by using `pagehide` as a proxy. Fixes [#29241](https://github.com/cypress-io/cypress/issues/29241). diff --git a/packages/driver/src/cypress/log.ts b/packages/driver/src/cypress/log.ts index cae0752593ea..18c886b2972b 100644 --- a/packages/driver/src/cypress/log.ts +++ b/packages/driver/src/cypress/log.ts @@ -569,7 +569,11 @@ export class Log { const expectedProperties = ['name', 'type', 'error', 'snapshot', 'args', 'groups', 'table', 'props'] const expectedPropertiesObj = _.reduce(_.pick(consoleObjResult, expectedProperties), (memo, value, key) => { // don't include properties with undefined values - return value === undefined ? memo : _.extend(memo, { [key]: value }) + if (value !== undefined) { + memo[key] = value + } + + return memo }, consoleObj) // any other key/value pairs need to be added to the `props` property const rest = _.omit(consoleObjResult, expectedProperties)