From 87502978c01f69c753bd278ff34c066ab9bdf47b Mon Sep 17 00:00:00 2001 From: AJ Jordan Date: Thu, 28 Sep 2017 02:41:00 -0400 Subject: [PATCH 1/2] Reenable credentials-test-as-root Ref #1226 --- test/credentials-test-as-root.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/credentials-test-as-root.js b/test/credentials-test-as-root.js index 89be9f3a7..e04ca79bc 100644 --- a/test/credentials-test-as-root.js +++ b/test/credentials-test-as-root.js @@ -269,6 +269,4 @@ suite.addBatch({ } }); -module.exports = {}; // TODO reenable this test when it's passing - -// suite["export"](module); +suite["export"](module); From 67ef52e120eb3471288b7a84107a547f1e015559 Mon Sep 17 00:00:00 2001 From: AJ Jordan Date: Mon, 6 Nov 2017 01:08:34 -0500 Subject: [PATCH 2/2] Fix Express 4 deprecations in credentials-test-as-root --- test/credentials-test-as-root.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/credentials-test-as-root.js b/test/credentials-test-as-root.js index e04ca79bc..aa6f06496 100644 --- a/test/credentials-test-as-root.js +++ b/test/credentials-test-as-root.js @@ -26,6 +26,8 @@ var assert = require("assert"), fs = require("fs"), path = require("path"), express = require("express"), + http = require("http"), + multipart = require("connect-multiparty"), DialbackClient = require("dialback-client"), databank = require("databank"), Databank = databank.Databank, @@ -42,13 +44,14 @@ var tc = JSON.parse(fs.readFileSync(path.join(__dirname, "config.json"))); var tinyApp = function(port, hostname, callback) { - var app = express.createServer(); + var app = express(), + appServer = http.createServer(app); app.set("port", port); app.use(express.json()); - app.use(express.urlencoded()); - app.use(express.multipart()); - app.use(app.router); + app.use(express.urlencoded({extended: true})); + // TODO: use the multiparty API directly instead of this Connect middleware wrapper + app.use(multipart()); app.get("/.well-known/host-meta.json", function(req, res) { res.json({ @@ -87,7 +90,7 @@ var tinyApp = function(port, hostname, callback) { }); app.listen(port, hostname, function() { - callback(null, app); + callback(null, appServer); }); };