Skip to content

Commit

Permalink
BC-5936 - add a couple of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
virgilchiriac committed Jan 8, 2024
1 parent eadee51 commit 961b7ee
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,16 @@ describe('ConsoleWriterService', () => {
it('should be defined', () => {
expect(service).toBeDefined();
});

it('should log info', () => {
const spy = jest.spyOn(console, 'info').mockImplementation(() => {});
service.info('test');
expect(spy).toHaveBeenCalledWith('Info:', 'test');
});

it('should log error', () => {
const spy = jest.spyOn(console, 'error').mockImplementation(() => {});
service.error('test');
expect(spy).toHaveBeenCalledWith('Error:', 'test');
});
});

0 comments on commit 961b7ee

Please sign in to comment.