Explorar el Código

Properly mock timeout and interval functions

Kirk Trombley hace 4 años
padre
commit
07412ae378
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  1. 7 1
      client/src/setupTests.js

+ 7 - 1
client/src/setupTests.js

@@ -23,4 +23,10 @@ global.window = {
   location: {
     href: "http://test-url-base/",
   }
-}
+}
+
+global.setTimeout = jest.fn();
+global.clearTimeout = jest.fn();
+
+global.setInterval = jest.fn();
+global.clearInterval = jest.fn();