mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-02-21 07:29:37 +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);
|
return handleNotify(metadata, config.notify);
|
||||||
} else {
|
} else {
|
||||||
// multiple notifications endpoints PR #108
|
// multiple notifications endpoints PR #108
|
||||||
for (const key in config.notify) {
|
return Promise.all(_.map(config.notify, (key) => handleNotify(metadata, key)));
|
||||||
if (config.notify.hasOwnProperty(key)) {
|
|
||||||
return handleNotify(metadata, config.notify[key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -86,9 +86,11 @@ module.exports = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
notify(metadata, multipleNotificationsEndpoint).then(function (body) {
|
notify(metadata, multipleNotificationsEndpoint).then(function (body) {
|
||||||
const jsonBody = JSON.parse(body);
|
body.forEach(function(notification) {
|
||||||
assert.ok(`New package published: * ${metadata.name}*` === jsonBody.message,
|
const jsonBody = JSON.parse(notification);
|
||||||
'Body notify message should be equal');
|
assert.ok(`New package published: * ${metadata.name}*` === jsonBody.message,
|
||||||
|
'Body notify message should be equal');
|
||||||
|
});
|
||||||
done();
|
done();
|
||||||
}, function (err) {
|
}, function (err) {
|
||||||
assert.fail(err);
|
assert.fail(err);
|
||||||
|
Loading…
Reference in New Issue
Block a user