Skip to content

Commit

Permalink
Removed an old test that checked the ws api works (which is now remov…
Browse files Browse the repository at this point in the history
…ed) and fixed a global leak in JSONP tests
  • Loading branch information
Tony Kovanen committed Apr 11, 2014
1 parent 32db7c4 commit 83caa81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
8 changes: 4 additions & 4 deletions test/jsonp.js
Expand Up @@ -77,8 +77,8 @@ describe('JSONP', function () {

after(function () {
delete document.getElementsByTagName
, document.createElement
, document;
, document.createElement;
delete global.document;
});

describe('handshake', function () {
Expand Down Expand Up @@ -114,7 +114,7 @@ describe('JSONP', function () {
});
});
});
});
});

it('should arrive from server to client and back with binary data (pollingJSONP)', function(done) {
var binaryData = new Buffer(5);
Expand All @@ -137,7 +137,7 @@ describe('JSONP', function () {
});
});
});

describe('close', function () {
it('should trigger when server closes a client', function (done) {
var engine = listen( { allowUpgrades: false, transports: ['polling'] }, function (port) {
Expand Down
20 changes: 0 additions & 20 deletions test/server.js
Expand Up @@ -895,26 +895,6 @@ describe('server', function () {
});
});

it('should arrive from server to client with ws api', function (done) {
var opts = { allowUpgrades: false, transports: ['websocket'] };
var engine = listen(opts, function (port) {
var socket = new eioc.Socket('ws://localhost:%d'.s(port), { transports: ['websocket'] });
engine.on('connection', function (conn) {
conn.send('a');
conn.close();
});
socket.onopen = function () {
socket.onmessage = function (msg) {
expect(msg.data).to.be('a');
expect('' + msg == 'a').to.be(true);
};
socket.onclose = function () {
done();
};
};
});
});

it('should arrive from server to client (ws)', function (done) {
var opts = { allowUpgrades: false, transports: ['websocket'] };
var engine = listen(opts, function (port) {
Expand Down

0 comments on commit 83caa81

Please sign in to comment.