UNPKG

halley

Version:

A bayeux client for modern browsers and node. Forked from Faye

53 lines (38 loc) 1.1 kB
'use strict'; var WebSocket = require('../lib/transport/node/node-websocket'); var uri = require('../lib/util/uri'); var Advice = require('../lib/protocol/advice'); describe('node websocket transport', function() { beforeEach(function() { this.dispatcher = { handleResponse: function() { }, handleError: function() { } }; this.advice = new Advice({ interval: 0, timeout: 1000, retry: 1 }); }); describe('direct', function() { beforeEach(function() { this.websocket = new WebSocket(this.dispatcher, uri.parse(this.urlDirect), this.advice); }); afterEach(function() { this.websocket.close(); }); require('./specs/websocket-spec')(); }); describe('proxied', function() { beforeEach(function() { this.websocket = new WebSocket(this.dispatcher, uri.parse(this.urlProxied), this.advice); }); afterEach(function() { this.websocket.close(); }); require('./specs/websocket-server-restart-spec')(); require('./specs/websocket-bad-connection-spec')(); }); });