@@ -4,10 +4,11 @@ const TEXT_NODE = 3
44
55function jestFakeTimersAreEnabled ( ) {
66 /* istanbul ignore else */
7+ // eslint-disable-next-line
78 if ( typeof jest !== 'undefined' && jest !== null ) {
89 return (
910 // legacy timers
10- setTimeout . _isMockFunction === true ||
11+ ( setTimeout as any ) . _isMockFunction === true ||
1112 // modern timers
1213 Object . prototype . hasOwnProperty . call ( setTimeout , 'clock' )
1314 )
@@ -23,7 +24,7 @@ function getDocument() {
2324 }
2425 return window . document
2526}
26- function getWindowFromNode ( node ) {
27+ function getWindowFromNode ( node : any ) {
2728 if ( node . defaultView ) {
2829 // node is document
2930 return node . defaultView
@@ -60,11 +61,11 @@ function getWindowFromNode(node) {
6061 }
6162}
6263
63- function checkContainerType ( container ) {
64+ function checkContainerType ( container : unknown ) {
6465 if (
6566 ! 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' )
6869 ) {
6970 throw new TypeError (
7071 `Expected container to be an Element, a Document or a DocumentFragment but got ${ getTypeName (
@@ -73,7 +74,7 @@ function checkContainerType(container) {
7374 )
7475 }
7576
76- function getTypeName ( object ) {
77+ function getTypeName ( object : unknown ) {
7778 if ( typeof object === 'object' ) {
7879 return object === null ? 'null' : object . constructor . name
7980 }
0 commit comments