mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-19 17:14:40 +00:00
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);
|
this.plugins.registerAPICall(method, endpoint, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
registerActionForEvent(name, cb) {
|
registerActionForEvent(name, options, cb) {
|
||||||
this.plugins.registerActionForEvent(name, cb);
|
this.plugins.registerActionForEvent(name, options, cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
registerConsoleCommand(options) {
|
registerConsoleCommand(options) {
|
||||||
|
@ -33,8 +33,8 @@ class Plugins {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
registerActionForEvent(name, cb) {
|
registerActionForEvent(name, options, cb) {
|
||||||
this.plugin.registerActionForEvent(name, cb);
|
this.plugin.registerActionForEvent(name, options, cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
registerAPICall(method, endpoint, callback) {
|
registerAPICall(method, endpoint, callback) {
|
||||||
@ -76,7 +76,11 @@ class Plugin {
|
|||||||
return this.listeners[name];
|
return this.listeners[name];
|
||||||
}
|
}
|
||||||
|
|
||||||
registerActionForEvent(name, action) {
|
registerActionForEvent(name, options, action) {
|
||||||
|
if (typeof options === 'function') {
|
||||||
|
action = options;
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.listeners[name]) {
|
if (!this.listeners[name]) {
|
||||||
this.listeners[name] = [];
|
this.listeners[name] = [];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user