Skip to content

Commit

Permalink
fix(plugin-load): clarify load message
Browse files Browse the repository at this point in the history
added quotes around plugin name to set it apart from the message. without the quotes, some consumers
were missunderstanding the successful loading of the `fail` plugin as a load failure and assuming
something was broken

resolves #811
  • Loading branch information
travi authored and gr2m committed Jun 6, 2018
1 parent 4d47b20 commit 6a36832
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/plugins/normalize.js
Expand Up @@ -15,9 +15,9 @@ module.exports = (pluginType, pluginsPath, globalOpts, pluginOpts, logger) => {

if (!isFunction(pluginOpts)) {
if (pluginsPath[path]) {
logger.log('Load plugin %s from %s in shareable config %s', pluginType, path, pluginsPath[path]);
logger.log('Load plugin "%s" from %s in shareable config %s', pluginType, path, pluginsPath[path]);
} else {
logger.log('Load plugin %s from %s', pluginType, path);
logger.log('Load plugin "%s" from %s', pluginType, path);
}
}

Expand Down
8 changes: 4 additions & 4 deletions test/plugins/normalize.test.js
Expand Up @@ -14,15 +14,15 @@ test('Normalize and load plugin from string', t => {

t.is(plugin.pluginName, './test/fixtures/plugin-noop');
t.is(typeof plugin, 'function');
t.deepEqual(t.context.log.args[0], ['Load plugin %s from %s', 'verifyConditions', './test/fixtures/plugin-noop']);
t.deepEqual(t.context.log.args[0], ['Load plugin "%s" from %s', 'verifyConditions', './test/fixtures/plugin-noop']);
});

test('Normalize and load plugin from object', t => {
const plugin = normalize('publish', {}, {}, {path: './test/fixtures/plugin-noop'}, t.context.logger);

t.is(plugin.pluginName, './test/fixtures/plugin-noop');
t.is(typeof plugin, 'function');
t.deepEqual(t.context.log.args[0], ['Load plugin %s from %s', 'publish', './test/fixtures/plugin-noop']);
t.deepEqual(t.context.log.args[0], ['Load plugin "%s" from %s', 'publish', './test/fixtures/plugin-noop']);
});

test('Normalize and load plugin from a base file path', t => {
Expand All @@ -37,7 +37,7 @@ test('Normalize and load plugin from a base file path', t => {
t.is(plugin.pluginName, './plugin-noop');
t.is(typeof plugin, 'function');
t.deepEqual(t.context.log.args[0], [
'Load plugin %s from %s in shareable config %s',
'Load plugin "%s" from %s in shareable config %s',
'verifyConditions',
'./plugin-noop',
'./test/fixtures',
Expand Down Expand Up @@ -85,7 +85,7 @@ test('Normalize and load plugin that retuns multiple functions', t => {
const plugin = normalize('verifyConditions', {}, {}, './test/fixtures/multi-plugin', t.context.logger);

t.is(typeof plugin, 'function');
t.deepEqual(t.context.log.args[0], ['Load plugin %s from %s', 'verifyConditions', './test/fixtures/multi-plugin']);
t.deepEqual(t.context.log.args[0], ['Load plugin "%s" from %s', 'verifyConditions', './test/fixtures/multi-plugin']);
});

test('Wrap "analyzeCommits" plugin in a function that validate the output of the plugin', async t => {
Expand Down

0 comments on commit 6a36832

Please sign in to comment.