Ver código fonte

Properly mock timeout and interval functions

Kirk Trombley 4 anos atrás
pai
commit
07412ae378
1 arquivos alterados com 7 adições e 1 exclusões
  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();