Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/wojtekmaj/react-hooks. A collection of React Hooks.
hooks react react-hooks
Something went wrong. Try again.
5.5 kB · 196 lines
TypeScript
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197import { describe, expect, it } from 'vitest';
import { useCurrentPosition, useDebouncedEffect, useDebouncedState, useDebouncedValue, useDeviceOrientation, useDocumentVisibility, useEventListener, useForcedColors, useIntersectionObserver, useIntersectionObserverRef, useLocalStorage, useMatchMedia, useMutationObserver, useMutationObserverRef, useOnLine, usePermissionState, usePrefersColorScheme, usePrefersColorSchemeDark, usePrefersColorSchemeLight, usePrefersContrast, usePrefersReducedMotion, usePrefersReducedTransparency, useResizeObserver, useResizeObserverRef, useScrollLeft, useScrollLeftDirection, useScrollLeftPercent, useScrollTop, useScrollTopDirection, useScrollTopPercent, useSessionStorage, useSetInterval, useSetTimeout, useTick, useToggle, useWindowHeight, useWindowSize, useWindowWidth,} from './index.js';
describe('index', () => { it('has useCurrentPosition exported properly', () => { expect(useCurrentPosition).toBeInstanceOf(Function); });
it('has useDebouncedEffect exported properly', () => { expect(useDebouncedEffect).toBeInstanceOf(Function); });
it('has useDebouncedState exported properly', () => { expect(useDebouncedState).toBeInstanceOf(Function); });
it('has useDebouncedValue exported properly', () => { expect(useDebouncedValue).toBeInstanceOf(Function); });
it('has useDeviceOrientation exported properly', () => { expect(useDeviceOrientation).toBeInstanceOf(Function); });
it('has useDocumentVisibility exported properly', () => { expect(useDocumentVisibility).toBeInstanceOf(Function); });
it('has useEventListener exported properly', () => { expect(useEventListener).toBeInstanceOf(Function); });
it('has useForcedColors exported properly', () => { expect(useForcedColors).toBeInstanceOf(Function); });
it('has useMatchMedia exported properly', () => { expect(useMatchMedia).toBeInstanceOf(Function); });
it('has useIntersectionObserver exported properly', () => { expect(useIntersectionObserver).toBeInstanceOf(Function); });
it('has useIntersectionObserverRef exported properly', () => { expect(useIntersectionObserverRef).toBeInstanceOf(Function); });
it('has useLocalStorage exported properly', () => { expect(useLocalStorage).toBeInstanceOf(Function); });
it('has useMutationObserver exported properly', () => { expect(useMutationObserver).toBeInstanceOf(Function); });
it('has useMutationObserverRef exported properly', () => { expect(useMutationObserverRef).toBeInstanceOf(Function); });
it('has useOnLine exported properly', () => { expect(useOnLine).toBeInstanceOf(Function); });
it('has usePermissionState exported properly', () => { expect(usePermissionState).toBeInstanceOf(Function); });
it('has usePrefersColorScheme exported properly', () => { expect(usePrefersColorScheme).toBeInstanceOf(Function); });
it('has usePrefersColorSchemeDark exported properly', () => { expect(usePrefersColorSchemeDark).toBeInstanceOf(Function); });
it('has usePrefersColorSchemeLight exported properly', () => { expect(usePrefersColorSchemeLight).toBeInstanceOf(Function); });
it('has usePrefersContrast exported properly', () => { expect(usePrefersContrast).toBeInstanceOf(Function); });
it('has usePrefersReducedMotion exported properly', () => { expect(usePrefersReducedMotion).toBeInstanceOf(Function); });
it('has usePrefersReducedTransparency exported properly', () => { expect(usePrefersReducedTransparency).toBeInstanceOf(Function); });
it('has useResizeObserver exported properly', () => { expect(useResizeObserver).toBeInstanceOf(Function); });
it('has useResizeObserverRef exported properly', () => { expect(useResizeObserverRef).toBeInstanceOf(Function); });
it('has useScrollLeft exported properly', () => { expect(useScrollLeft).toBeInstanceOf(Function); });
it('has useScrollLeftDirection exported properly', () => { expect(useScrollLeftDirection).toBeInstanceOf(Function); });
it('has useScrollLeftPercent exported properly', () => { expect(useScrollLeftPercent).toBeInstanceOf(Function); });
it('has useScrollTop exported properly', () => { expect(useScrollTop).toBeInstanceOf(Function); });
it('has useScrollTopDirection exported properly', () => { expect(useScrollTopDirection).toBeInstanceOf(Function); });
it('has useScrollTopPercent exported properly', () => { expect(useScrollTopPercent).toBeInstanceOf(Function); });
it('has useSessionStorage exported properly', () => { expect(useSessionStorage).toBeInstanceOf(Function); });
it('has useSetInterval exported properly', () => { expect(useSetInterval).toBeInstanceOf(Function); });
it('has useSetTimeout exported properly', () => { expect(useSetTimeout).toBeInstanceOf(Function); });
it('has useTick exported properly', () => { expect(useTick).toBeInstanceOf(Function); });
it('has useToggle exported properly', () => { expect(useToggle).toBeInstanceOf(Function); });
it('has useWindowHeight exported properly', () => { expect(useWindowHeight).toBeInstanceOf(Function); });
it('has useWindowSize exported properly', () => { expect(useWindowSize).toBeInstanceOf(Function); });
it('has useWindowWidth exported properly', () => { expect(useWindowWidth).toBeInstanceOf(Function); });});