@@ -4,10 +4,11 @@ const TEXT_NODE = 3
4
4
5
5
function jestFakeTimersAreEnabled ( ) {
6
6
/* istanbul ignore else */
7
+ // eslint-disable-next-line
7
8
if ( typeof jest !== 'undefined' && jest !== null ) {
8
9
return (
9
10
// legacy timers
10
- setTimeout . _isMockFunction === true ||
11
+ ( setTimeout as any ) . _isMockFunction === true ||
11
12
// modern timers
12
13
Object . prototype . hasOwnProperty . call ( setTimeout , 'clock' )
13
14
)
@@ -23,7 +24,7 @@ function getDocument() {
23
24
}
24
25
return window . document
25
26
}
26
- function getWindowFromNode ( node ) {
27
+ function getWindowFromNode ( node : any ) {
27
28
if ( node . defaultView ) {
28
29
// node is document
29
30
return node . defaultView
@@ -60,11 +61,11 @@ function getWindowFromNode(node) {
60
61
}
61
62
}
62
63
63
- function checkContainerType ( container ) {
64
+ function checkContainerType ( container : unknown ) {
64
65
if (
65
66
! container ||
66
- ! ( typeof container . querySelector === 'function' ) ||
67
- ! ( typeof container . querySelectorAll === 'function' )
67
+ ! ( typeof ( container as any ) . querySelector === 'function' ) ||
68
+ ! ( typeof ( container as any ) . querySelectorAll === 'function' )
68
69
) {
69
70
throw new TypeError (
70
71
`Expected container to be an Element, a Document or a DocumentFragment but got ${ getTypeName (
@@ -73,7 +74,7 @@ function checkContainerType(container) {
73
74
)
74
75
}
75
76
76
- function getTypeName ( object ) {
77
+ function getTypeName ( object : unknown ) {
77
78
if ( typeof object === 'object' ) {
78
79
return object === null ? 'null' : object . constructor . name
79
80
}
0 commit comments