mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-11-13 03:35:52 +01:00
Merge pull request #354 from ayusharma/issue-352
Notification for multiple endpoints
This commit is contained in:
commit
6ea99e39c6
@ -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)));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user