Skip to content

Commit

Permalink
chore: code style
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed Dec 28, 2015
1 parent a47f850 commit 9099a1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ export function resolvePlugins(pluginNames, resolveDir, cwd) {
return pluginNames.map(pluginName => resolvePlugin(pluginName, resolveDir, cwd));
}

export function applyPlugins(plugins, name, context = {}, pluginArgs, _callback = function noop() {}) {
if (!plugins || !plugins.length) return _callback();
export function applyPlugins(plugins, name, context, pluginArgs, _callback = function noop() {}) {
let ret;

reduceAsync(plugins, pluginArgs, (memo, plugin, callback) => {
Expand Down
4 changes: 4 additions & 0 deletions test/fixtures/plugin-run/plugin-a.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ module.exports = {
name: 'a',
'middleware.before': function() {
a = 'foo';
this.log.info('a');
this.log.warn('a');
this.log.debug('a');
this.log.error('a');
},
'middleware': function() {
return function *(next) {
Expand Down
1 change: 1 addition & 0 deletions test/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ describe('index', () => {
],
port,
cwd: join(__dirname, 'fixtures/plugin-run'),
verbose: true,
}, done);
});

Expand Down

0 comments on commit 9099a1c

Please sign in to comment.