Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test fail with finalhandler > 0.2.0 #1059

Closed
LeoIannacone opened this issue Oct 17, 2014 · 3 comments
Closed

Test fail with finalhandler > 0.2.0 #1059

LeoIannacone opened this issue Oct 17, 2014 · 3 comments

Comments

@LeoIannacone
Copy link

Hi,

with finalhandler v0.3.0 this test fails:

  36 passing (80ms)
  1 failing

  1) app 404 handler should escape the 404 response body:
     TypeError: Object #<Object> has no method 'listeners'
      at unpipe (/home/l3on/Sources/maintaining/nodejs/node-connect/node-connect/node_modules/finalhandler/index.js:159:26)
      at send (/home/l3on/Sources/maintaining/nodejs/node-connect/node-connect/node_modules/finalhandler/index.js:135:3)
      at /home/l3on/Sources/maintaining/nodejs/node-connect/node-connect/node_modules/finalhandler/index.js:96:5
      at next (/home/l3on/Sources/maintaining/nodejs/node-connect/node-connect/lib/proto.js:117:7)
      at Function.app.handle (/home/l3on/Sources/maintaining/nodejs/node-connect/node-connect/lib/proto.js:152:3)
      at Context.<anonymous> (/home/l3on/Sources/maintaining/nodejs/node-connect/node-connect/test/server.js:69:11)
      at Test.Runnable.run (/usr/lib/nodejs/mocha/lib/runnable.js:196:15)
      at Runner.runTest (/usr/lib/nodejs/mocha/lib/runner.js:373:10)
      at /usr/lib/nodejs/mocha/lib/runner.js:451:12
      at next (/usr/lib/nodejs/mocha/lib/runner.js:298:14)
      at /usr/lib/nodejs/mocha/lib/runner.js:308:7
      at next (/usr/lib/nodejs/mocha/lib/runner.js:246:23)
      at Object._onImmediate (/usr/lib/nodejs/mocha/lib/runner.js:275:5)
      at processImmediate [as _immediateCallback] (timers.js:330:15)

I'm not pretty sure if it's more related to finalhandler then connect...

@dougwilson
Copy link
Contributor

What connect branch is this? The versions of finalhanlder are pinned and I don't think the tests are currently failing. Maybe it's the version of node? What version of node are you using?

@dougwilson
Copy link
Contributor

I'm going to close this for now, because there are no released connect versions that are compatible with finalhandler 0.3.0, which is why tests may fail. 0.x series of releases in semver mean they are unstable and can have breaking changes at any time. In finalhandler, there was a subtle breaking change between 0.2.x and 0.3.0, which may be the reason. Since connect is not (yet) compatible with 0.3.0, this is a non-issue, since connect explicitly depends on 0.2.0.

I'm not sure how you got a 0.3.0 finalhandler in your node_module folder, but you can just delete your node_module and just run a install to fix it:

$ cd /home/l3on/Sources/maintaining/nodejs/node-connect/node-connect
$ rm -rf node_modules/
$ npm install

That should re-install your modules based on the requirements of connect for you.

@dougwilson
Copy link
Contributor

In the end, the test failure is because connect is mocking a request, which is just a big fat no-no, because it causes things like this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants