From 624c3b40b70f921eec5a7e0a075c6fb6eea944a0 Mon Sep 17 00:00:00 2001 From: daileytj Date: Fri, 2 Jul 2021 12:03:34 -0400 Subject: [PATCH] Mock global scrollTo method --- package.json | 5 +---- src/app/___tests___/App.test.tsx | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index cfefe63f2..c262b873b 100644 --- a/package.json +++ b/package.json @@ -215,10 +215,7 @@ "jest-watch-typeahead/filename", "jest-watch-typeahead/testname" ], - "resetMocks": true, - "globals": { - "window": {} - } + "resetMocks": true }, "babel": { "presets": [ diff --git a/src/app/___tests___/App.test.tsx b/src/app/___tests___/App.test.tsx index 854cb4d99..8de89d13f 100644 --- a/src/app/___tests___/App.test.tsx +++ b/src/app/___tests___/App.test.tsx @@ -7,6 +7,8 @@ import { MainRouter } from '../router'; import { Reducer } from '../redux/reducers'; const store = createStore(Reducer()); +global.scrollTo = jest.fn(); + it('renders without crashing', () => { const div = document.createElement('div'); ReactDOM.render(