Skip to content

Commit

Permalink
removes mock logger expected counts, just check if error logs are cal…
Browse files Browse the repository at this point in the history
…led, don't care about debug / warn etc.
  • Loading branch information
dhurley14 committed Nov 14, 2019
1 parent f8fb916 commit 9bb8e14
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ describe('utils', () => {
mockService,
mockLogger
);
expect(mockLogger.debug).toHaveBeenCalledTimes(2);
expect(mockLogger.warn).toHaveBeenCalledTimes(0);
expect(successfulSingleBulkIndex).toEqual(true);
});
test('create unsuccessful bulk index due to empty search results', async () => {
Expand All @@ -107,8 +105,6 @@ describe('utils', () => {
mockService,
mockLogger
);
expect(mockLogger.debug).toHaveBeenCalledTimes(0);
expect(mockLogger.error).toHaveBeenCalledTimes(0);
expect(successfulSingleBulkIndex).toEqual(true);
});
test('create unsuccessful bulk index due to bulk index errors', async () => {
Expand All @@ -125,9 +121,7 @@ describe('utils', () => {
mockService,
mockLogger
);
expect(mockLogger.debug).toHaveBeenCalledTimes(2);
expect(mockLogger.warn).toHaveBeenCalledTimes(0);
expect(mockLogger.error).toHaveBeenCalledTimes(1);
expect(mockLogger.error).toHaveBeenCalled();
expect(successfulSingleBulkIndex).toEqual(false);
});
});
Expand Down Expand Up @@ -228,7 +222,7 @@ describe('utils', () => {
mockService,
mockLogger
);
expect(mockLogger.error).toHaveBeenCalledTimes(2);
expect(mockLogger.error).toHaveBeenCalled();
expect(result).toEqual(false);
});
test('if unsuccessful iteration of searchAfterAndBulkIndex due to empty sort ids', async () => {
Expand All @@ -249,7 +243,7 @@ describe('utils', () => {
mockService,
mockLogger
);
expect(mockLogger.error).toHaveBeenCalledTimes(1);
expect(mockLogger.error).toHaveBeenCalled();
expect(result).toEqual(false);
});
test('if unsuccessful iteration of searchAfterAndBulkIndex due to empty sort ids and 0 total hits', async () => {
Expand Down Expand Up @@ -312,7 +306,7 @@ describe('utils', () => {
mockService,
mockLogger
);
expect(mockLogger.error).toHaveBeenCalledTimes(2);
expect(mockLogger.error).toHaveBeenCalled();
expect(result).toEqual(true);
});
test('if returns false when singleSearchAfter throws an exception', async () => {
Expand Down

0 comments on commit 9bb8e14

Please sign in to comment.