Skip to content

Commit

Permalink
Mock global scrollTo method
Browse files Browse the repository at this point in the history
  • Loading branch information
daileytj committed Jul 2, 2021
1 parent b8cc235 commit 624c3b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,7 @@
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname"
],
"resetMocks": true,
"globals": {
"window": {}
}
"resetMocks": true
},
"babel": {
"presets": [
Expand Down
2 changes: 2 additions & 0 deletions src/app/___tests___/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 624c3b4

Please sign in to comment.