Skip to content

Commit

Permalink
add server startup message
Browse files Browse the repository at this point in the history
  • Loading branch information
darthfiddler committed Aug 25, 2018
1 parent 5f2b391 commit 4ed6b94
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const Koa = require('koa');

import { DBFromEnv } from './db';
import { createApiServer } from './api';
import * as logger from '../core/logger';
import { SocketIO } from './transport/socketio';

/**
Expand Down Expand Up @@ -42,6 +43,7 @@ export function Server({ games, db, transport }) {
await db.connect();
await api.listen(port + 1);
await app.listen(port, callback);
logger.info('listening...');
},
};
}
5 changes: 5 additions & 0 deletions src/server/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ import Game from '../core/game';

const game = Game({ seed: 0 });

jest.mock('../core/logger', () => ({
info: () => {},
error: () => {},
}));

jest.mock('./api', () => ({
createApiServer: () => ({
listen: async () => {},
Expand Down

0 comments on commit 4ed6b94

Please sign in to comment.