* Check if the IntersectionObserver is currently being mocked. * @return boolean
()
| 30 | * @return boolean |
| 31 | */ |
| 32 | function isMocking() { |
| 33 | const util = testLibraryUtil(); |
| 34 | if (util && typeof util.isMockFunction === "function") { |
| 35 | return util.isMockFunction(window.IntersectionObserver); |
| 36 | } |
| 37 | |
| 38 | // No global test utility found. Check if the IntersectionObserver was manually mocked. |
| 39 | if ( |
| 40 | typeof window !== "undefined" && |
| 41 | window.IntersectionObserver && |
| 42 | "mockClear" in window.IntersectionObserver |
| 43 | ) { |
| 44 | return true; |
| 45 | } |
| 46 | |
| 47 | return false; |
| 48 | } |
| 49 | |
| 50 | /* |
| 51 | ** If we are running in a valid testing environment, we can automate mocking the IntersectionObserver. |
no test coverage detected
searching dependent graphs…