Skip to content
Browse files

pass port via command line, pass expected data via command line

  • Loading branch information...
1 parent 913f290 commit 5feef41663f9d8c6ad0161c4bb39892981035a8a @pkrumins committed Dec 31, 2012
Showing with 7 additions and 4 deletions.
  1. +1 −1 package.json
  2. +5 −2 server.js
  3. +1 −1 test/xhr.js
View
2 package.json
@@ -6,7 +6,7 @@
},
"testling" : {
"files" : "test/*.js",
- "server" : "node server.js 8642",
+ "server" : "node server.js 8642 beep-boop",
"browsers" : {
"iexplore" : [ "9.0" ],
"chrome" : [ "20.0" ],
View
7 server.js
@@ -1,7 +1,10 @@
var http = require('http');
+var port = process.argv.slice(2)[0];
+var str = process.argv.slice(2)[1];
+
var server = http.createServer(function (req, res) {
res.setHeader('access-control-allow-origin', '*');
- res.end('beep boop\n');
+ res.end(str + '\n');
});
-server.listen(8642);
+server.listen(port);
View
2 test/xhr.js
@@ -9,7 +9,7 @@ tape('xhr request', function (t) {
var data = '';
res.on('data', function (buf) { data += buf });
res.on('end', function () {
- t.equal(data, 'beep boop\n');
+ t.equal(data, 'beep-boop\n');
});
});
});

0 comments on commit 5feef41

Please sign in to comment.
Something went wrong with that request. Please try again.