erunion / showtimes

[deprecated] a movie showtimes API
MIT License
52 stars 14 forks source link

Failing unit tests. #9

Closed erunion closed 9 years ago

erunion commented 9 years ago

https://travis-ci.org/jonursenbach/showtimes/builds/47564386

> showtimes@0.3.0 test /home/travis/build/jonursenbach/showtimes
> tap test/
TypeError: Cannot read property 'length' of undefined
    at /home/travis/build/jonursenbach/showtimes/test/index.js:25:21
    at Request._callback (/home/travis/build/jonursenbach/showtimes/index.js:86:7)
    at Request.self.callback (/home/travis/build/jonursenbach/showtimes/node_modules/request/request.js:373:22)
    at Request.emit (events.js:98:17)
    at Request.<anonymous> (/home/travis/build/jonursenbach/showtimes/node_modules/request/request.js:1318:14)
    at Request.emit (events.js:117:20)
    at IncomingMessage.<anonymous> (/home/travis/build/jonursenbach/showtimes/node_modules/request/request.js:1266:12)
    at IncomingMessage.emit (events.js:117:20)
    at _stream_readable.js:944:16
    at process._tickCallback (node.js:442:13)
not ok test/index.js .................................... 1/2
    Command: "/home/travis/.nvm/v0.10.35/bin/node index.js"
    TAP version 13
    ok 1 type is string
    not ok 2 test/index.js
      ---
        exit:    8
        stderr:  |
          TypeError: Cannot read property 'length' of undefined
              at /home/travis/build/jonursenbach/showtimes/test/index.js:25:21
              at Request._callback (/home/travis/build/jonursenbach/showtimes/index.js:86:7)
              at Request.self.callback (/home/travis/build/jonursenbach/showtimes/node_modules/request/request.js:373:22)
              at Request.emit (events.js:98:17)
              at Request.<anonymous> (/home/travis/build/jonursenbach/showtimes/node_modules/request/request.js:1318:14)
              at Request.emit (events.js:117:20)
              at IncomingMessage.<anonymous> (/home/travis/build/jonursenbach/showtimes/node_modules/request/request.js:1266:12)
              at IncomingMessage.emit (events.js:117:20)
              at _stream_readable.js:944:16
              at process._tickCallback (node.js:442:13)
        command: "/home/travis/.nvm/v0.10.35/bin/node index.js"
      ...

    1..2
    # tests 2
    # pass  1
    # fail  1

total ................................................... 1/2
not ok
npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0
The command "npm test" exited with 1.
jstart commented 9 years ago

I am not sure how my changes caused this build failure... It seems like there is no .theater in the HTML output of this search: http://google.com/movies?near=94118

Shouldn't that be caught by the error check right at the beginning of the request callback though?

erunion commented 9 years ago

Yeah your PR definitely wasn't the cause. Something must have changed with the DOM structure.

jstart commented 9 years ago

@jonursenbach looks like google's results changed, not the structure. Submitted a PR with a new zip code and lat lng.

erunion commented 9 years ago

Unit tests no longer failing. Thanks for the fix, dude.

jstart commented 9 years ago

:+1:

jstart commented 9 years ago

Guess what? The bay area zipcode works again... http://google.com/movies?near=94118 . Noticed because my test is failing.

erunion commented 9 years ago

lol. ffs. Yay webscraping. ಠ_ಠ