Permalink
Browse files

Add support for a manual testing server

  • Loading branch information...
brycekahle committed Sep 21, 2018
1 parent 4027289 commit 1a0f46adac3164462b54c7f90fb56f276a4ba6fd
Showing with 9 additions and 3 deletions.
  1. +1 −1 karma.conf.js
  2. +6 −0 tests/support/manual.js
  3. +2 −2 tests/support/sockjs_server.js
View
@@ -8,7 +8,7 @@ var port = 9889;
var SockFrameworkFactory = function(config, logger) {
var log = logger.create('sockjs.server');
log.info('Starting sockjs test server...');
testServer(port, config);
testServer(port, config, '/sockjs-test');
};
module.exports = function(config) {
View
@@ -0,0 +1,6 @@
'use strict';
require('./sockjs_server')(8081, {
listenAddress: '127.0.0.1',
port: 8081
});
@@ -8,7 +8,7 @@ var url = require('url');
var path = require('path');
var debug = require('debug')('sockjs-client:test-server:main');
function startServer(port, config) {
function startServer(port, config, prefix) {
var clientOptions = {
// Address of a sockjs test server.
url: 'http://' + config.listenAddress + ':' + config.port,
@@ -61,7 +61,7 @@ function startServer(port, config) {
});
sockjs.install({
sockjs_url: 'http://' + config.listenAddress + ':' + config.port + '/sockjs-test/lib/sockjs.js',
sockjs_url: 'http://' + config.listenAddress + ':' + config.port + (prefix || '') + '/lib/sockjs.js',
websocket: true,
log: function (severity, message) {
debug('[%s] %s', severity, message);

0 comments on commit 1a0f46a

Please sign in to comment.