diff --git a/lib/api/client-commands/perform.js b/lib/api/client-commands/perform.js index 15d3c66b4..f81f0b816 100644 --- a/lib/api/client-commands/perform.js +++ b/lib/api/client-commands/perform.js @@ -62,9 +62,13 @@ class Perform extends EventEmitter { return true; } + static get avoidPrematureParentNodeResolution() { + return true; + } + command(callback = function() {}) { let doneCallback; - let asyncHookTimeout = this.client.settings.globals.asyncHookTimeout; + const asyncHookTimeout = this.client.settings.globals.asyncHookTimeout; this.timeoutId = setTimeout(() => { this.emit('error', new Error(`Timeout while waiting (${asyncHookTimeout}ms) for the .perform() command callback to be called.`)); @@ -99,7 +103,7 @@ class Perform extends EventEmitter { }; } else { doneCallback = () => { - let args = [(result) => { + const args = [(result) => { clearTimeout(this.timeoutId); this.emit('complete', result); }];