mirror of https://github.com/embarklabs/embark.git
fix(utils/testing): teach testing APIs request options
This commit is contained in:
parent
deb682c9d2
commit
4199124e40
|
@ -26,8 +26,8 @@ class Embark {
|
|||
this.plugins.registerAPICall(method, endpoint, callback);
|
||||
}
|
||||
|
||||
registerActionForEvent(name, cb) {
|
||||
this.plugins.registerActionForEvent(name, cb);
|
||||
registerActionForEvent(name, options, cb) {
|
||||
this.plugins.registerActionForEvent(name, options, cb);
|
||||
}
|
||||
|
||||
registerConsoleCommand(options) {
|
||||
|
|
|
@ -33,8 +33,8 @@ class Plugins {
|
|||
}
|
||||
}
|
||||
|
||||
registerActionForEvent(name, cb) {
|
||||
this.plugin.registerActionForEvent(name, cb);
|
||||
registerActionForEvent(name, options, cb) {
|
||||
this.plugin.registerActionForEvent(name, options, cb);
|
||||
}
|
||||
|
||||
registerAPICall(method, endpoint, callback) {
|
||||
|
@ -76,7 +76,11 @@ class Plugin {
|
|||
return this.listeners[name];
|
||||
}
|
||||
|
||||
registerActionForEvent(name, action) {
|
||||
registerActionForEvent(name, options, action) {
|
||||
if (typeof options === 'function') {
|
||||
action = options;
|
||||
}
|
||||
|
||||
if (!this.listeners[name]) {
|
||||
this.listeners[name] = [];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue