assert.response. second request after response #155

zxcabs opened this Issue Nov 15, 2011 · 8 comments


None yet

5 participants

zxcabs commented Nov 15, 2011

node v0.6.1
expresso v0.9.2

How i can do second request using data from first response?

For example, on expresso v0.8.1, i can do this as:

assert.response(server, {
      url: '/',
      method: 'GET'
    }, {
      body: 'Hello World\n',
      status: 200,
      headers: {'Content-Type': 'text/plain'}
   }, function (res) {
      //now i can use res for second request
     assert.response(server, { url: '/foo', data: res.body }, ....); 

But, on expresso v0.9.2 this code drop error:

uncaught undefined: Error: connect ECONNREFUSED
at errnoException (net.js:614:11)
at Object.afterConnect [as oncomplete] (net.js:605:18)

So, how can i do it?

gitfy commented Nov 15, 2011

Yes, this problem came after upgrading to node 0.6.1, it wasn't there before that. The same version was running fine with node 0.4.2.

zxcabs commented Nov 16, 2011

And so, what can me do? Return to node v0.4.x or waiting fix?

emostar commented Dec 21, 2011

Ant idea when expresso will support node 0.6?

nmcclay commented Jan 18, 2012

I'm adding a plus one to this, I really would like to be able to write more than one assert.response for a given test.


Any news?

emostar commented Jun 29, 2012

I would say, switch to mocha... that is what I did.

There is no assert.response in mocha, but you can include a http library that will do the same thing. I can send you a gist if want to see how I did it.


Thank you for your advice - I will be grateful for gist.


That's my solution - pretty fast switching!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment