cstephen / hashtag-count

Count hashtag occurrences over time using Twitter's Streaming API.
MIT License
7 stars 4 forks source link

Add unit test coverage for all optional settings and callbacks #5

Closed cstephen closed 7 years ago

cstephen commented 7 years ago

I'm not 100% sure if it's possible to unit test an ongoing/unlimited hashtag-count process, but I haven't done enough research into the possibilities yet. Everything else should be testable though, I think. This is important for maintaining backwards compatibility.

cstephen commented 7 years ago

Tests have been implemented for everything except the optional reconnectingCb callback. I'm not sure if it's feasible to test reconnectingCb since it requires intentionally losing/breaking a Twitter Streaming API connection to force it to reconnect. I've managed to make this happen in the past by setting the timeout value below 30 seconds in hashtag-count.js, but that value is purposefully inaccessible outside of the library.