Permalink
Browse files

Change require() to use relative and npm paths.

  • Loading branch information...
1 parent 7fd1771 commit 5bb00631c18e75151250c09af852752af2f93917 @pgriess committed Jul 6, 2010
View
@@ -1,15 +1,8 @@
# This makefile exists to help run tests.
-#
-# We depend on an installation of miksago-node-websocket-server. We'll
-# include $HOME/src/miksago-node-websocket-server/lib in $NODE_PATH by
-# default. An alternate location can be specified by setting the
-# NODE_WS_SERVER_PATH make variable when invoking make.
-
-NODE_WS_SERVER_PATH ?= $(HOME)/src/miksago-node-websocket-server/lib
.PHONY: test
test:
for f in `ls -1 test/test-*.js` ; do \
- NODE_PATH=./lib:$(NODE_WS_SERVER_PATH):$(NODE_PATH) node $$f ; \
+ node $$f ; \
done
View
@@ -1,5 +1,5 @@
var sys = require('sys');
-var WebSocket = require('websocket').WebSocket;
+var WebSocket = require('../lib/websocket').WebSocket;
var ws = new WebSocket('ws+unix://' + process.argv[2], 'boffo');
View
@@ -1,5 +1,5 @@
var sys = require('sys');
-var WebSocket = require('websocket').WebSocket;
+var WebSocket = require('../lib/websocket').WebSocket;
var ws = new WebSocket('ws://localhost:8000/biff', 'borf');
ws.addListener('data', function(buf) {
View
@@ -1,5 +1,5 @@
var sys = require('sys');
-var ws = require('ws');
+var ws = require('websocket-server/ws');
var srv = ws.createServer({ debug : true});
srv.addListener('connection', function(s) {
View
@@ -2,8 +2,8 @@
// shut down cleanly.
var assert = require('assert');
-var WebSocket = require('websocket').WebSocket;
-var WebSocketServer = require('ws').Server;
+var WebSocket = require('../lib/websocket').WebSocket;
+var WebSocketServer = require('websocket-server/ws').Server;
var PORT = 1024 + Math.floor(Math.random() * 4096);
var C_MSG = 'Client test: ' + (Math.random() * 100);
@@ -2,8 +2,8 @@
var assert = require('assert');
var sys = require('sys');
-var WebSocket = require('websocket').WebSocket;
-var WebSocketServer = require('ws').Server;
+var WebSocket = require('../lib/websocket').WebSocket;
+var WebSocketServer = require('websocket-server/ws').Server;
var PORT = 1024 + Math.floor(Math.random() * 4096);
View
@@ -1,8 +1,8 @@
// Verify that readyState transitions are implemented correctly
var assert = require('assert');
-var WebSocket = require('websocket').WebSocket;
-var WebSocketServer = require('ws').Server;
+var WebSocket = require('../lib/websocket').WebSocket;
+var WebSocketServer = require('websocket-server/ws').Server;
var PORT = 1024 + Math.floor(Math.random() * 4096);
@@ -5,8 +5,8 @@ var assert = require('assert');
var fs = require('fs');
var path = require('path');
var sys = require('sys');
-var WebSocket = require('websocket').WebSocket;
-var WebSocketServer = require('ws').Server;
+var WebSocket = require('../lib/websocket').WebSocket;
+var WebSocketServer = require('websocket-server/ws').Server;
var PATH = path.join(__dirname, 'sock.' + process.pid);
var C_MSG = 'Client test: ' + (Math.random() * 100);
@@ -4,8 +4,8 @@ var assert = require('assert');
var fs = require('fs');
var path = require('path');
var sys = require('sys');
-var WebSocket = require('websocket').WebSocket;
-var WebSocketServer = require('ws').Server;
+var WebSocket = require('../lib/websocket').WebSocket;
+var WebSocketServer = require('websocket-server/ws').Server;
var PATH = path.join(__dirname, 'sock.' + process.pid);
var S_MSG = 'Server test: ' + (Math.random() * 100);

0 comments on commit 5bb0063

Please sign in to comment.