File tree 1 file changed +11
-10
lines changed
packages/driver/src/cy/commands/querying
1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change 1
1
import _ from 'lodash'
2
2
3
+ interface InternalRootOptions extends Partial < Cypress . Loggable & Cypress . Timeoutable > {
4
+ _log ?: any
5
+ }
6
+
3
7
export default ( Commands , Cypress , cy , state ) => {
4
8
Commands . addAll ( {
5
- // TODO: any -> Partial<Cypress.Loggable & Cypress.Timeoutable>
6
- root ( options : any = { } ) {
7
- const userOptions = options
8
-
9
- options = _ . defaults ( { } , userOptions , { log : true } )
9
+ root ( options : Partial < Cypress . Loggable & Cypress . Timeoutable > = { } ) {
10
+ const _options : InternalRootOptions = _ . defaults ( { } , options , { log : true } )
10
11
11
- if ( options . log !== false ) {
12
- options . _log = Cypress . log ( {
12
+ if ( _options . log !== false ) {
13
+ _options . _log = Cypress . log ( {
13
14
message : '' ,
14
- timeout : options . timeout ,
15
+ timeout : _options . timeout ,
15
16
} )
16
17
}
17
18
18
19
const log = ( $el ) => {
19
- if ( options . log ) {
20
- options . _log . set ( { $el } )
20
+ if ( _options . log ) {
21
+ _options . _log . set ( { $el } )
21
22
}
22
23
23
24
return $el
You can’t perform that action at this time.
0 commit comments