Merge pull request #4 from Joe-Dowd/testing-custom-webhooks

Fixed undesolved test error
This commit is contained in:
Epic
2020-08-24 23:52:00 +02:00
committed by GitHub
3 changed files with 13 additions and 1 deletions

View File

@@ -45,6 +45,8 @@ const settings = {
if (config.mode === 'development') {
settings.INFO = true;
settings.DEBUG = true;
} else if (config.mode === 'test') {
settings.WARN = false;
}
function log(level, string) {

View File

@@ -38,7 +38,10 @@ function dispatchEvent(scope, data) {
request.post(webhookURL, {json: data, headers: {
"Authorization": authKey,
"Event-Type": scope // Maybe change this in the future?
}});
}}).on('error', (e) => {
logger.warn('Couldn\'t send webhook to ' + webhook.url);
logger.warn(e);
});
});
}

View File

@@ -31,6 +31,13 @@
"vote.up",
"vote.down"
]
}, {
"url": "http://127.0.0.1:8099/WrongPort",
"key": "superSecretKey",
"scopes": [
"vote.up",
"vote.down"
]
}, {
"url": "http://unresolvable.host:8081/FailedWebhook",
"key": "superSecretKey",