mirror of
https://github.com/streamich/react-use.git
synced 2026-01-18 14:06:52 +00:00
Merge pull request #1668 from dovidweisz/fix-jest-issues
fix: Fix issues in tests
This commit is contained in:
commit
f48ca43f0c
@ -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();
|
||||
});
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user