UNPKG

react-native-reanimated-carousel

Version:

Simple carousel component.fully implemented using Reanimated 2.Infinitely scrolling, very smooth.

2 lines 1.54 kB
var _reactHooks=require("@testing-library/react-hooks");var _useCheckMounted=require("./useCheckMounted");describe("useCheckMounted",function(){it("should be mounted after initialization",function(){var _renderHook=(0,_reactHooks.renderHook)(function(){return(0,_useCheckMounted.useCheckMounted)();}),result=_renderHook.result;expect(result.current.current).toBe(true);});it("should be unmounted after cleanup",function(){var _renderHook2=(0,_reactHooks.renderHook)(function(){return(0,_useCheckMounted.useCheckMounted)();}),result=_renderHook2.result,unmount=_renderHook2.unmount;expect(result.current.current).toBe(true);unmount();expect(result.current.current).toBe(false);});it("should maintain mounted state during component lifecycle",function(){var _renderHook3=(0,_reactHooks.renderHook)(function(){return(0,_useCheckMounted.useCheckMounted)();}),result=_renderHook3.result,rerender=_renderHook3.rerender;expect(result.current.current).toBe(true);rerender();expect(result.current.current).toBe(true);});it("should handle multiple mount/unmount cycles",function(){var hook1=(0,_reactHooks.renderHook)(function(){return(0,_useCheckMounted.useCheckMounted)();});expect(hook1.result.current.current).toBe(true);hook1.unmount();expect(hook1.result.current.current).toBe(false);var hook2=(0,_reactHooks.renderHook)(function(){return(0,_useCheckMounted.useCheckMounted)();});expect(hook2.result.current.current).toBe(true);hook2.unmount();expect(hook2.result.current.current).toBe(false);});}); //# sourceMappingURL=useCheckMounted.test.js.map