Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermendes committed Aug 23, 2021
1 parent 730bce5 commit ec8d01d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
22 changes: 13 additions & 9 deletions src/launch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
6 changes: 5 additions & 1 deletion src/services/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/logger/create.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ describe('Logger', () => {

expect(writeSpy).toHaveBeenCalledTimes(1);
expect(writeSpy.mock.calls[0][0]).toEqual(
expect.stringContaining('Hello')
)
expect.stringContaining('Hello'),
);
},
);

Expand All @@ -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', () => {
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/router/router.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

0 comments on commit ec8d01d

Please sign in to comment.