Unit testing
Syntro42 opened this issue · comments
Syntro commented
Hi! I would like to use this package in a discord bot I’m creating. Would there be any way to include unit tests with this package? I want to mimic responses I would get back from a Minecraft server for testing purposes. Thanks!
Justin Li commented
A couple options:
- call
emit
on the Rcon object to emit aresponse
event. The only event argument is the data as a string. - extract your response callback into a separate function and simply call it
This library doesn’t have any knowledge of what’s actually in an Rcon request or response, it just treats it as an opaque blob of data. So you’ll need to come up with the format of a valid response yourself.
Syntro commented
Thanks!