From 7b7c3d2d362ac1ec86cdc4ebabd700b5ca3125c4 Mon Sep 17 00:00:00 2001 From: Guillermo Rauch Date: Sat, 18 Jun 2011 17:46:42 -0300 Subject: [PATCH] Added first integration test. Disabled for node until we have node transports. --- test/socket.test.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test/socket.test.js diff --git a/test/socket.test.js b/test/socket.test.js new file mode 100644 index 00000000..28e8fefe --- /dev/null +++ b/test/socket.test.js @@ -0,0 +1,30 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * 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 +);