SpiderStrategies / node-tweet-stream

Node twitter module to hook into the public filter streaming, seamlessly updating the tracking keywords.
210 stars 43 forks source link

Reconnect, same filter #27

Closed rj76 closed 9 years ago

rj76 commented 9 years ago

There's a test that counts reconnects when adding the same filter, what's the idea behind this? Isn't it unnecessary (/unwanted) to reconnect when already connected for that filter?

nathanbowser commented 9 years ago

Yea, this test is kind of wrong:

it.only('avoids dups in tracking stream', function () {
      var called = 0
      twitter.reconnect = function () {
        called++
      }

      assert(!twitter.stream)
      twitter.track('tacos')
      twitter.track('tacos')
      twitter.track('tacos')
      assert.deepEqual(twitter.tracking(), ['tacos'])
      assert(called, 3)
    })

Well, the functionality it's testing is wrong. I'll fix it.

nathanbowser commented 9 years ago

Actually reconnect tests for stale, and prevents a reconnect. It's kind of confusing and bad, but I can at least improve the test.