Skip to content

Commit 0cbaf83

Browse files
committed
test: mock reanimated layout/entering builders to fix ChatBar suite
1 parent df84af0 commit 0cbaf83

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

__mocks__/react-native-reanimated.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ const Animated = {
3232
createAnimatedComponent,
3333
};
3434

35+
type AnimationBuilder = Record<
36+
string,
37+
(...args: unknown[]) => AnimationBuilder
38+
>;
39+
40+
const makeAnimationBuilder = (): AnimationBuilder => {
41+
const builder = new Proxy(
42+
{},
43+
{ get: () => () => builder }
44+
) as AnimationBuilder;
45+
return builder;
46+
};
47+
3548
module.exports = {
3649
__esModule: true,
3750
default: Animated,
@@ -73,4 +86,9 @@ module.exports = {
7386
interpolateColor: (val: any, _r: any, outputRange: any) => outputRange[0],
7487
runOnJS: (fn: any) => fn,
7588
runOnUI: (fn: any) => fn,
89+
configureReanimatedLogger: () => {},
90+
LinearTransition: makeAnimationBuilder(),
91+
FadeIn: makeAnimationBuilder(),
92+
FadeInDown: makeAnimationBuilder(),
93+
FadeOut: makeAnimationBuilder(),
7694
};

0 commit comments

Comments
 (0)