make tests hit webhook code

This commit is contained in:
Joe Dowd
2020-08-24 22:04:18 +01:00
parent 3085b0e30c
commit 75a62a5729
2 changed files with 14 additions and 1 deletions

View File

@@ -16,5 +16,12 @@
"privateDBSchema": "./databases/_private.db.sql", "privateDBSchema": "./databases/_private.db.sql",
"mode": "test", "mode": "test",
"readOnly": false, "readOnly": false,
"webhooks": [] "webhooks": [{
"url": "http://127.0.0.1:8081/CustomWebhook",
"key": "superSecretKey",
"scopes": [
"vote.up",
"vote.down"
]
}]
} }

View File

@@ -15,6 +15,12 @@ app.post('/CompletelyIncorrectReportWebhook', (req, res) => {
res.sendStatus(200); res.sendStatus(200);
}); });
app.post('/CustomWebhook', (req, res) => {
res.sendStatus(200);
});
module.exports = function createMockServer(callback) { module.exports = function createMockServer(callback) {
return app.listen(config.mockPort, callback); return app.listen(config.mockPort, callback);
} }