Merge pull request #1668 from dovidweisz/fix-jest-issues

fix: Fix issues in tests
This commit is contained in:
Anton Zinovyev 2021-01-07 17:43:24 +03:00 committed by GitHub
commit f48ca43f0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -81,7 +81,7 @@ describe('useIntersection', () => {
it('should return null if IntersectionObserver is not supported', () => {
targetRef = createRef();
targetRef.current = document.createElement('div');
delete window.IntersectionObserver;
delete (window as any).IntersectionObserver;
expect(() => renderHook(() => useIntersection(targetRef, {}))).not.toThrow();
});

View File

@ -6,7 +6,7 @@ const { location } = window;
let mockSearch: string;
beforeEach(() => {
delete window.location;
delete (window as any).location;
const { search, ...restLocation } = location;
// @ts-ignore