logux/server

Allow to provide a reporter to the Server

ertrzyiks opened this issue · 1 comments

Hi,

I'm trying to add tests for my server class and to do that I need to pass a reporter mock. It's possible only with BaseServer, but Server class builds reporter on it's own.

class MyServer extends Server {
 ...
}

new MyServer(options, reporterMock) // it doesn't work

The solution could be to inherit from BaseServer and copy-paste the bootstrap code from Server

class MyServer extends BaseServer {
 ...copy paste Server code here
}

new MyServer(options, reporterMock) // it works!

What do you think about adding an option to override reporter in Server class as well? Or maybe compose Server with BaseServer instead of inherit from it?

ai commented

I like the idea too override reporter in Server, good idea.

Please send PR.