visionmedia / expresso

use mocha
http://visionmedia.github.com/expresso
759 stars 89 forks source link

assert.response error inside another response call #154

Closed zdwalter closed 13 years ago

zdwalter commented 13 years ago

version: localhost:test zdwalter$ node -v v0.6.0 localhost:test zdwalter$ expresso -v 0.9.2

code:

exports['all'] = function(){
    var assert = require('assert');
    var app = require('app');
    assert.response(app,
            { url: '/' },
            { status: 200, headers: { 'Content-Type': 'text/html; charset=utf-8' }},
            function(res){

                var app = require('app');
                var assert = require('assert');
                assert.response(app,
                    { url: '/' },
                    { status: 200, headers: { 'Content-Type': 'text/html; charset=utf-8' }},
                    function(res){
                        console.log('done');
                    });
            });
};

error:

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

^C
   test.js all: Error: Response not completed: all. 
    at Function.response (/usr/local/lib/node_modules/expresso/bin/expresso:400:17)
    at /Users/zdwalter/SandBox/test/test/test.js:12:24
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/expresso/bin/expresso:524:21)
    at IncomingMessage.emit (events.js:88:20)
    at HTTPParser.onMessageComplete (http.js:137:23)
    at Socket.ondata (http.js:1125:24)
    at TCP.onread (net.js:334:27)
kkaefer commented 13 years ago

It looks like starting the app server fails.

zdwalter commented 13 years ago

the app.js is generated by express, which is an empty app. and it worked with node v0.4.12

gaarf commented 13 years ago

same as https://github.com/visionmedia/expresso/issues/151

zdwalter commented 13 years ago

ya, duplicate issue. I will try to find some work around without nested call.