RITlug / teleirc

Go implementation of a Telegram <=> IRC bridge for use with any IRC channel and Telegram group
https://docs.teleirc.com/
GNU General Public License v3.0
140 stars 45 forks source link

Add unit tests to validate main TeleIRC bot #191

Closed Tjzabel closed 4 years ago

Tjzabel commented 5 years ago

At this point, we need to start creating unit tests for config parsing (if needed), and the main TeleIRC file.

Tjzabel commented 5 years ago

This is an ongoing effort.

We are still deciding on the best way to lay out our Go code for the most effective testing. This requires us to lay out our explicit function dependencies, and making sure we either move function dependencies to interfaces, or into the parameters.

jwflory commented 4 years ago

@Tjzabel will follow up in this issue.

Some code excerpts related to what we discussed on the developer call today:

https://github.com/RITlug/teleirc/blob/ddd980ac4ade0e75b044f9f1ce6e389d34cff173/internal/handlers/telegram/telegram_test.go#L11-L19

https://github.com/RITlug/teleirc/blob/ddd980ac4ade0e75b044f9f1ce6e389d34cff173/internal/handlers/irc/irc_test.go#L28-L29

Tjzabel commented 4 years ago

Since we have decided that the main teleirc.go file is nothing but a shell calling other functions/files we've written (where all the testing would actually be), I am okay with marking this issue as closed.

The comment above falls in line with the external dependencies issue, and I don't believe is directly related to writing unit tests for the main TeleIRC entrypoint.