Skip to content

Commit

Permalink
✅ Add coverage for new codepath
Browse files Browse the repository at this point in the history
  • Loading branch information
wwilsman committed Mar 19, 2021
1 parent 843dc1a commit 9a5e59c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/logger/test/remote.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ describe('remote logging', () => {
]);
});

it('logs a fallback debug message when an error is emitted without one', async () => {
setTimeout(() => socket.emit('error', { type: 'error' }), 100);

logger.loglevel('debug');
await logger.remote(socket);

expect(helpers.stderr).toEqual([
'[percy:logger] Unable to connect to remote logger',
'[percy:logger] Error: Socket connection failed'
]);
});

it('logs a local debug error when the connection times out', async () => {
logger.loglevel('debug');
await logger.remote(socket, 10);
Expand Down

0 comments on commit 9a5e59c

Please sign in to comment.