diff --git a/packages/react-native-reanimated/__tests__/hooks.useAnimatedStyle.test.tsx b/packages/react-native-reanimated/__tests__/hooks.useAnimatedStyle.test.tsx new file mode 100644 index 00000000000..edb18da0e2c --- /dev/null +++ b/packages/react-native-reanimated/__tests__/hooks.useAnimatedStyle.test.tsx @@ -0,0 +1,91 @@ +import { Button, View } from 'react-native'; +import { fireEvent, render, screen } from '@testing-library/react-native'; +import Animated, { + useSharedValue, + getAnimatedStyle, + useAnimatedStyle, + withTiming, +} from '../src'; + +jest.useFakeTimers(); + +describe('Tests of inline styles', () => { + beforeEach(() => { + jest.useFakeTimers(); + }); + + afterEach(() => { + jest.runOnlyPendingTimers(); + jest.useRealTimers(); + }); + + test('useAnimatedStyle', () => { + function UseAnimatedStyle() { + const width = useSharedValue(100); + + const handlePress = () => { + width.value = width.value + 50; + }; + + const animatedStyle = useAnimatedStyle(() => { + return { + width: width.value, + }; + }, [width]); + + return ( + + +