diff --git a/packages/driver/src/cy/commands/querying/root.ts b/packages/driver/src/cy/commands/querying/root.ts index a9e12fd16d66..f9494a4c4c1c 100644 --- a/packages/driver/src/cy/commands/querying/root.ts +++ b/packages/driver/src/cy/commands/querying/root.ts @@ -1,23 +1,24 @@ import _ from 'lodash' +interface InternalRootOptions extends Partial { + _log?: any +} + export default (Commands, Cypress, cy, state) => { Commands.addAll({ - // TODO: any -> Partial - root (options: any = {}) { - const userOptions = options - - options = _.defaults({}, userOptions, { log: true }) + root (options: Partial = {}) { + const _options: InternalRootOptions = _.defaults({}, options, { log: true }) - if (options.log !== false) { - options._log = Cypress.log({ + if (_options.log !== false) { + _options._log = Cypress.log({ message: '', - timeout: options.timeout, + timeout: _options.timeout, }) } const log = ($el) => { - if (options.log) { - options._log.set({ $el }) + if (_options.log) { + _options._log.set({ $el }) } return $el