feat: allow to define multiple generateNotes plugins

Each `generateNotes` plugin will be called in the order defined and will receive the concatenation of the previous one in `nextRelease.notes`.
That gives each plugin the ability to test if there is a notes part that will precede it's own.
Each plugin is expected to return it's own part of the release notes only. **semantic-release** will take care of concatenating all the notes parts.
This commit is contained in:
Pierre Vanduynslager
2018-07-10 13:18:58 -04:00
parent 576eb6027f
commit 5989989452
7 changed files with 96 additions and 34 deletions
+3 -3
View File
@@ -34,15 +34,15 @@ test('The "verifyRelease" plugin, if defined, must be a single or an array of pl
t.true(plugins.verifyRelease.configValidator([{path: 'plugin-path.js'}, 'plugin-path.js', () => {}]));
});
test('The "generateNotes" plugin, if defined, must be a single plugin definition', t => {
test('The "generateNotes" plugin, if defined, must be a single or an array of plugins definition', t => {
t.false(plugins.generateNotes.configValidator({}));
t.false(plugins.generateNotes.configValidator({path: null}));
t.false(plugins.generateNotes.configValidator([]));
t.true(plugins.generateNotes.configValidator());
t.true(plugins.generateNotes.configValidator({path: 'plugin-path.js'}));
t.true(plugins.generateNotes.configValidator());
t.true(plugins.generateNotes.configValidator('plugin-path.js'));
t.true(plugins.generateNotes.configValidator(() => {}));
t.true(plugins.generateNotes.configValidator([{path: 'plugin-path.js'}, 'plugin-path.js', () => {}]));
});
test('The "prepare" plugin, if defined, must be a single or an array of plugins definition', t => {