Skip to content

Commit 1a0f46a

Browse files
committed
Add support for a manual testing server
1 parent 4027289 commit 1a0f46a

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var port = 9889;
88
var SockFrameworkFactory = function(config, logger) {
99
var log = logger.create('sockjs.server');
1010
log.info('Starting sockjs test server...');
11-
testServer(port, config);
11+
testServer(port, config, '/sockjs-test');
1212
};
1313

1414
module.exports = function(config) {

tests/support/manual.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
'use strict';
2+
3+
require('./sockjs_server')(8081, {
4+
listenAddress: '127.0.0.1',
5+
port: 8081
6+
});

tests/support/sockjs_server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var url = require('url');
88
var path = require('path');
99
var debug = require('debug')('sockjs-client:test-server:main');
1010

11-
function startServer(port, config) {
11+
function startServer(port, config, prefix) {
1212
var clientOptions = {
1313
// Address of a sockjs test server.
1414
url: 'http://' + config.listenAddress + ':' + config.port,
@@ -61,7 +61,7 @@ function startServer(port, config) {
6161
});
6262

6363
sockjs.install({
64-
sockjs_url: 'http://' + config.listenAddress + ':' + config.port + '/sockjs-test/lib/sockjs.js',
64+
sockjs_url: 'http://' + config.listenAddress + ':' + config.port + (prefix || '') + '/lib/sockjs.js',
6565
websocket: true,
6666
log: function (severity, message) {
6767
debug('[%s] %s', severity, message);

0 commit comments

Comments
 (0)