From ec8d01d71d5a71ef53fb05e41ceb94e296681d9c Mon Sep 17 00:00:00 2001 From: alexmendes Date: Mon, 23 Aug 2021 04:04:38 +0100 Subject: [PATCH] chore: format --- src/launch.ts | 22 +++++++++++++--------- src/services/service.ts | 6 +++++- tests/unit/logger/create.spec.ts | 8 ++++---- tests/unit/router/router.spec.ts | 4 +++- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/launch.ts b/src/launch.ts index 93bcdf1..b844eb6 100644 --- a/src/launch.ts +++ b/src/launch.ts @@ -26,15 +26,19 @@ export const launch = async ( await server.launch(config.port); - await Promise.all(serviceNames.map(async (serviceName) => { - const service = services.find((service) => service.getName() === serviceName) - - if (!service) { - logger.warn(`Not a valid service name: ${serviceName}`); - } - - return service?.launch(); - })) + await Promise.all( + serviceNames.map(async (serviceName) => { + const service = services.find( + (service) => service.getName() === serviceName, + ); + + if (!service) { + logger.warn(`Not a valid service name: ${serviceName}`); + } + + return service?.launch(); + }), + ); printServicesTable(services); diff --git a/src/services/service.ts b/src/services/service.ts index 24cba66..a348f4e 100644 --- a/src/services/service.ts +++ b/src/services/service.ts @@ -49,7 +49,11 @@ export class Service { }, 500); setTimeout(() => { - logger.debug(new Error(`Timed out waiting for service to launch: ${this.getName()}`)); + logger.debug( + new Error( + `Timed out waiting for service to launch: ${this.getName()}`, + ), + ); resolve(false); }, launchTimeout); }); diff --git a/tests/unit/logger/create.spec.ts b/tests/unit/logger/create.spec.ts index 5cf265b..14d0f4a 100644 --- a/tests/unit/logger/create.spec.ts +++ b/tests/unit/logger/create.spec.ts @@ -24,8 +24,8 @@ describe('Logger', () => { expect(writeSpy).toHaveBeenCalledTimes(1); expect(writeSpy.mock.calls[0][0]).toEqual( - expect.stringContaining('Hello') - ) + expect.stringContaining('Hello'), + ); }, ); @@ -37,8 +37,8 @@ describe('Logger', () => { expect(writeSpy).toHaveBeenCalledTimes(1); expect(String(writeSpy.mock.calls[0][0])).toEqual( - expect.stringContaining('bad thing') - ) + expect.stringContaining('bad thing'), + ); }); it('does not log messages below the log level', () => { diff --git a/tests/unit/router/router.spec.ts b/tests/unit/router/router.spec.ts index c8267c7..61bd346 100644 --- a/tests/unit/router/router.spec.ts +++ b/tests/unit/router/router.spec.ts @@ -13,7 +13,9 @@ const mockChokidar = mocked(chokidar); const mockGlobSync = mocked(glob.sync); const createServices = (serviceConfigs: ServiceConfig[]) => - serviceConfigs.map((serviceConfig) => new Service(1, serviceConfig, null, null)); + serviceConfigs.map( + (serviceConfig) => new Service(1, serviceConfig, null, null), + ); describe('Router', () => { beforeEach(() => {