You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/06/20 21:33:51 UTC

[GitHub] brodybits closed pull request #160: Fix btest by using express (instead of connect, etc.)

brodybits closed pull request #160: Fix btest by using express (instead of connect, etc.)
URL: https://github.com/apache/cordova-js/pull/160
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/package.json b/package.json
index 8fcc9330..3f986a9f 100644
--- a/package.json
+++ b/package.json
@@ -75,6 +75,7 @@
     "eslint-plugin-node": "^5.1.1",
     "eslint-plugin-promise": "^3.5.0",
     "eslint-plugin-standard": "^3.0.1",
+    "express": "^4.16.3",
     "grunt": "^1.0.1",
     "grunt-contrib-clean": "^1.0.0",
     "istanbul": "^0.4.5",
diff --git a/tasks/lib/test-browser.js b/tasks/lib/test-browser.js
index 9b7fc512..5933b9b4 100644
--- a/tasks/lib/test-browser.js
+++ b/tasks/lib/test-browser.js
@@ -22,10 +22,10 @@
 
 var fs       = require('fs');
 var path     = require('path');
-var connect  = require('connect');
-var bundle   = require('./bundle');
+
+var express  = require('express');
+
 var collect  = require('./collect');
-var start    = require('open');
 
 var testLibName    = path.join(__dirname, '..', '..', 'pkg', 'cordova.test.js');
 var testLib        = fs.readFileSync(testLibName, 'utf8');
@@ -77,16 +77,16 @@ function routes(app) {
 module.exports = function() {
     console.log('starting browser-based tests');
 
-    var vendor = connect.static(pathToVendor);
-    var jasmine = connect.static(pathToJasmine);
-    var tests  = connect.static(pathToTests);
-    var router = connect.router(routes);
+    var app = express();
+
+    app.set('port', 3000);
 
-    connect(vendor, jasmine, tests, router).listen(3000);
+    app.use(express.static(pathToVendor));
+    app.use(express.static(pathToJasmine));
+    app.use(express.static(pathToTests));
 
-    console.log("Test Server running on:\n");
-    console.log("http://127.0.0.1:3000\n");
+    routes(app);
 
-    start('http://127.0.0.1:3000');
+    app.listen(3000, () => console.log('Test Server running on: http://localhost:3000'));
 };
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org