diff --git a/src/lib/notify.js b/src/lib/notify.js index 8ad49ff61..c77a04f0a 100644 --- a/src/lib/notify.js +++ b/src/lib/notify.js @@ -69,11 +69,7 @@ const notify = function(metadata, config) { return handleNotify(metadata, config.notify); } else { // multiple notifications endpoints PR #108 - for (const key in config.notify) { - if (config.notify.hasOwnProperty(key)) { - return handleNotify(metadata, config.notify[key]); - } - } + return Promise.all(_.map(config.notify, (key) => handleNotify(metadata, key))); } } }; diff --git a/test/functional/notifications/notify.js b/test/functional/notifications/notify.js index f15cc7b86..cbcfbe3c6 100644 --- a/test/functional/notifications/notify.js +++ b/test/functional/notifications/notify.js @@ -86,9 +86,11 @@ module.exports = function() { } notify(metadata, multipleNotificationsEndpoint).then(function (body) { - const jsonBody = JSON.parse(body); - assert.ok(`New package published: * ${metadata.name}*` === jsonBody.message, - 'Body notify message should be equal'); + body.forEach(function(notification) { + const jsonBody = JSON.parse(notification); + assert.ok(`New package published: * ${metadata.name}*` === jsonBody.message, + 'Body notify message should be equal'); + }); done(); }, function (err) { assert.fail(err);