File: echo-server-default-port.patch

package info (click to toggle)
node-websocket 1.0.33%2B~cs9.0.11-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 752 kB
  • sloc: javascript: 3,786; ansic: 176; makefile: 16; sh: 7
file content (46 lines) | stat: -rw-r--r-- 1,504 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Description: use a less well-known port for tests
 Still not ideal, but hard to properly setup considering the code base
Last-Update: 2019-01-24
Author: Jérémy Lal <kapouer@melix.org>
Forwarded: no
--- a/test/shared/start-echo-server.js
+++ b/test/shared/start-echo-server.js
@@ -13,7 +13,7 @@
   
   console.log(path);
     
-  var echoServer = require('child_process').spawn('node', [ path ]);
+  var echoServer = require('child_process').spawn('node', [ path, '--port=47512' ]);
   
   var state = 'starting';
   
--- a/test/unit/regressions.js
+++ b/test/unit/regressions.js
@@ -26,6 +26,6 @@
       t.end();
     });
     
-    client.connect('ws://localhost:8080', null);
+    client.connect('ws://localhost:47512', null);
   });
 });
--- a/test/unit/w3cwebsocket.js
+++ b/test/unit/w3cwebsocket.js
@@ -11,7 +11,7 @@
   startEchoServer(function(err, echoServer) {
     if (err) { return t.fail('Unable to start echo server: ' + err); }
 
-    var ws = new WebSocket('ws://localhost:8080/');
+    var ws = new WebSocket('ws://localhost:47512/');
 
     ws.onopen = function() {
       t.equal(++counter, 1, 'onopen should be called first');
@@ -45,7 +45,7 @@
   startEchoServer(function(err, echoServer) {
     if (err) { return t.fail('Unable to start echo server: ' + err); }
 
-    var ws = new WebSocket('ws://localhost:8080/');
+    var ws = new WebSocket('ws://localhost:47512/');
 
     ws.addEventListener('open', function() {
       t.equal(++counter, 1, '"open" should be fired first');