Added first integration test. Disabled for node until we have node transports.

This commit is contained in:
Guillermo Rauch
2011-06-18 17:46:42 -03:00
parent 9ccd67fd0a
commit 7b7c3d2d36

30
test/socket.test.js Normal file
View File

@@ -0,0 +1,30 @@
/*!
* socket.io-node
* Copyright(c) 2011 LearnBoost <dev@learnboost.com>
* MIT Licensed
*/
(function (module, io, should) {
if ('object' == typeof global) {
return module.exports = { '': function () {} };
}
module.exports = {
'test connecting the socket and disconnecting': function (next) {
var socket = new io.Socket({ host: 'localhost', port: 3000 });
socket.on('connect', function () {
socket.disconnect();
next();
});
}
};
})(
'undefined' == typeof module ? module = {} : module
, 'undefined' == typeof io ? require('socket.io-client') : io
, 'undefined' == typeof should ? require('should-browser') : should
);