Skip to content

Commit fbe9c83

Browse files
committed
typescript typing issue
1 parent ba69077 commit fbe9c83

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

jest.setup.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ global.rateCall = async function rateCall<T>(
2828
const result = await fn();
2929

3030
// If the API returns 429, throw to trigger retry
31-
if ('status' in result && result.status === 429) {
31+
if (result && typeof result === 'object' && 'status' in result && result.status === 429) {
3232
throw { code: 3505, message: 'Service tier capacity exceeded' };
3333
}
3434

35+
3536
lastCall = Date.now();
3637
return result;
3738
} catch (err: any) {

0 commit comments

Comments
 (0)