Skip to content

Commit c4d6d35

Browse files
committed
wip
1 parent 3aae603 commit c4d6d35

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

examples/expo-app/__tests__/Index.test.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,22 @@ describe('Index', () => {
1515
// Wait for the subscription status to be updated
1616
await waitFor(
1717
() => {
18-
expect(getByTestId('realtime_status')).toHaveTextContent('SUBSCRIBED')
18+
const status = getByTestId('realtime_status').props.children
19+
expect(status).toBe('SUBSCRIBED')
1920
},
2021
{
21-
timeout: 10000,
22+
timeout: 30000, // 30 seconds timeout for waitFor
23+
interval: 1000, // Check every second
24+
onTimeout: (error) => {
25+
const currentStatus = getByTestId('realtime_status').props.children
26+
throw new Error(
27+
`Timeout waiting for SUBSCRIBED status. Current status: ${currentStatus}. ${error.message}`
28+
)
29+
},
2230
}
2331
)
2432

2533
// Unmount the component to trigger cleanup.
2634
unmount()
27-
}, 10000)
35+
}, 35000) // 35 seconds timeout for the entire test
2836
})

0 commit comments

Comments
 (0)