Skip to content

Commit

Permalink
fix(utils/testing): ensure runActionsForEvent() works without params …
Browse files Browse the repository at this point in the history
…object
  • Loading branch information
0x-r4bbit authored and iurimatias committed Feb 26, 2020
1 parent ef1ec3a commit 62a2291
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/utils/testing/src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ class Plugins {
}

runActionsForEvent(name, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}

const listeners = this.plugin.getListeners(name);
if (listeners) {
listeners.forEach(fn => fn.spy(options, callback));
Expand Down

0 comments on commit 62a2291

Please sign in to comment.