mirror of https://github.com/embarklabs/embark.git
fix(utils/testing): ensure runActionsForEvent() works without params object
This commit is contained in:
parent
ef1ec3a606
commit
62a229198b
|
@ -20,6 +20,11 @@ class Plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
runActionsForEvent(name, options, callback) {
|
runActionsForEvent(name, options, callback) {
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
callback = options;
|
||||||
|
options = {};
|
||||||
|
}
|
||||||
|
|
||||||
const listeners = this.plugin.getListeners(name);
|
const listeners = this.plugin.getListeners(name);
|
||||||
if (listeners) {
|
if (listeners) {
|
||||||
listeners.forEach(fn => fn.spy(options, callback));
|
listeners.forEach(fn => fn.spy(options, callback));
|
||||||
|
|
Loading…
Reference in New Issue