Skip to content

Instantly share code, notes, and snippets.

@dvv
Created June 2, 2011 20:20
Show Gist options
  • Save dvv/1005221 to your computer and use it in GitHub Desktop.
Save dvv/1005221 to your computer and use it in GitHub Desktop.
socket.io-node.0.7-tests
var assert = require('assert');
var http = require('http');
function server(port) {
var srv = http.createServer(function(req, res) {
res.writeHead(200);
res.end('Hello!');
});
srv.listen(port);
return srv;
}
function client(port) {
var req = http.request({
method: 'GET',
host: 'localhost',
port: port,
path: '/foo',
headers: {
Host: 'localhost'
}
}, function(res) {
var buf = '';
res.setEncoding('utf8');
res.on('end', function() {
console.log(buf);
});
res.on('data', function(chunk) {
buf += chunk;
});
});
req.end();
return req;
}
module.exports = {
'smoke test': function(be) {
/*be(function() {
assert.ok(true);
});*/
server(15101);
client(15101);
}
};
info - socket.io started
uncaught: Error: 'test message buffering and websocket payload' timed out
at Object._onTimeout (/usr/local/lib/node/expresso/bin/expresso:781:43)
at Timer.callback (timers.js:83:39)
Failures: 1
make[1]: *** [run-tests] Ошибка 1
make: *** [test] Прерывание
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment