chore: repo wide lint fixes

This commit is contained in:
Bijin A B
2025-12-03 09:44:50 +05:30
parent 4a38f2d49f
commit 62cf4139d7
460 changed files with 6921 additions and 7052 deletions

View File

@@ -14,26 +14,26 @@ describe('executeRequestOnFailHandler', () => {
it('should do nothing when request is null', async () => {
const error = new Error('Test error');
await executeRequestOnFailHandler(null, error);
expect(consoleSpy).not.toHaveBeenCalled();
});
it('should do nothing when request is undefined', async () => {
const error = new Error('Test error');
await executeRequestOnFailHandler(undefined, error);
expect(consoleSpy).not.toHaveBeenCalled();
});
it('should do nothing when onFailHandler is not a function', async () => {
const request = { onFailHandler: 'not a function' };
const error = new Error('Test error');
await executeRequestOnFailHandler(request, error);
expect(consoleSpy).not.toHaveBeenCalled();
});
@@ -41,9 +41,9 @@ describe('executeRequestOnFailHandler', () => {
const mockHandler = jest.fn();
const request = { onFailHandler: mockHandler };
const error = new Error('Test error');
await executeRequestOnFailHandler(request, error);
expect(mockHandler).toHaveBeenCalledWith(error);
expect(mockHandler).toHaveBeenCalledTimes(1);
expect(consoleSpy).not.toHaveBeenCalled();
@@ -98,15 +98,15 @@ describe('executeRequestOnFailHandler', () => {
} catch (err) {
error = err;
}
// Verify this is actually a hard error (no response)
expect(error.response).toBeUndefined();
await executeRequestOnFailHandler(request, error);
expect(mockHandler).toHaveBeenCalledWith(error);
const passedError = mockHandler.mock.calls[0][0];
expect(passedError.response).toBeUndefined(); // Should be undefined for hard errors
expect(passedError.code).toBe('ECONNABORTED'); // Connection aborted due to timeout
});
});
});