totallymike / ircnode

Extensible IRC bot written with node.js
https://github.com/totallymike/ircnode/wiki
MIT License
4 stars 2 forks source link

More test cases #49

Open totallymike opened 12 years ago

totallymike commented 12 years ago

Trying to practice TDD. With new issues, test cases to demonstrate are needed. Furthermore, I need to write more test cases to prove existing functionality and locate broken edge cases.

sigv commented 12 years ago

TDD looks very interesting. Seems like something worth a try.

I also believe that the current test cases should be modified to also check the real responses. With that meaning the responses the server gets back. This can be done by opening a connection/socket with the bot and emulating the server on the test module. There should be a require('ircnode').connectTest() (or similar) for this. Then the test module would send PING and the other messages.

totallymike commented 12 years ago

I know how it can be done, and am working on it currently.

totallymike commented 12 years ago

I don't much like the idea of code written purely for testing ending up in the main module. The module should be leaner than it is, in fact. My plan was to throw up a basic net socket to sling events at the bot. That's what I did.

sigv commented 12 years ago

50 is what I was implying. I was just thinking that the special connect function would connect to the localhost:12345, but that works even better.