Skip to content

Commit 926e091

Browse files
committed
fix: passing callback as initialProps
1 parent 50a8085 commit 926e091

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/hooks/useAnimationLoop/useAnimationLoop.test.tsx

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@ describe('useAnimationLoop', () => {
1717
},
1818
{
1919
initialProps: {
20-
callback: () => {
21-
spy();
22-
},
20+
callback: spy,
2321
},
2422
},
2523
);
2624

27-
waitFor(() => {
25+
await waitFor(() => {
2826
expect(spy).toBeCalledTimes(0);
2927
});
3028
});
@@ -37,9 +35,7 @@ describe('useAnimationLoop', () => {
3735
},
3836
{
3937
initialProps: {
40-
callback: () => {
41-
spy();
42-
},
38+
callback: spy,
4339
enabled: true,
4440
},
4541
},
@@ -60,9 +56,7 @@ describe('useAnimationLoop', () => {
6056
},
6157
{
6258
initialProps: {
63-
callback: () => {
64-
spyFirstRender();
65-
},
59+
callback: spyFirstRender,
6660
enabled: true,
6761
},
6862
},
@@ -89,9 +83,7 @@ describe('useAnimationLoop', () => {
8983
},
9084
{
9185
initialProps: {
92-
callback: () => {
93-
spy();
94-
},
86+
callback: spy,
9587
enabled: true,
9688
},
9789
},

0 commit comments

Comments
 (0)