Take the 2-minute tour ×

I wanna use socket.io-client to test my socket.io server. And I tried to run expresso with the following file. The data is printed in console. Then the process hangs there and beforeExit is never executed until I terminate the process with Ctrl-C. I suppose after the callback is done from the server, beforeExit should be called and then the process stops. But it is not like that, Why?

var assert = require('assert');
exports.testAsync = function(beforeExit){
    var io = require('socket.io-client');
    var socket = io.connect('http://localhost:8000');
    socket.on('connect', function(err) {
        socket.emit('set nickname', 'apple', function(data) {
        assert.equal(data, 'ok');
share|improve this question

1 Answer 1

Strange. I'm using Expresso 0.9.2 and exactly the same code you wrote works as expected. But of course, I don't have any server running.

Is this the entire content of your test file?

share|improve this answer
Could you try this: github.com/visionmedia/expresso/pull/148 ? It works in my computer. –  JuanIgnacioIglesias Oct 29 '11 at 18:15

Your Answer


