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

assert.response. second request after response #155

Open
zxcabs opened this issue Nov 15, 2011 · 8 comments
Open

assert.response. second request after response #155

zxcabs opened this issue Nov 15, 2011 · 8 comments

Comments

@zxcabs
Copy link

zxcabs commented Nov 15, 2011

node v0.6.1
expresso v0.9.2

Hi,
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
Copy link

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
Copy link
Author

zxcabs commented Nov 16, 2011

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

@emostar
Copy link

emostar commented Dec 21, 2011

Ant idea when expresso will support node 0.6?

@nmcclay
Copy link

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.

@Zenedith
Copy link

Any news?

@emostar
Copy link

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.

@Zenedith
Copy link

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

@Zenedith
Copy link

That's my solution - pretty fast switching!
https://gist.github.com/3024952

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

5 participants