Navigation Menu

Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Provide more context when test fails due to timeout in waitsFor #17351

Merged
merged 1 commit into from May 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions vendor/jasmine.js
Expand Up @@ -2317,6 +2317,14 @@ jasmine.Spec.prototype.waitsFor = function(latchFunction, optional_timeoutMessag
}
}

if (optional_timeoutMessage_ == null) {
const objectToCaptureStack = {}
Error.captureStackTrace(objectToCaptureStack, waitsFor)
const stack = objectToCaptureStack.stack
const line = stack.split('\n')[1]
optional_timeoutMessage_ = `condition ${line}`
}

var waitsForFunc = new jasmine.WaitsForBlock(this.env, optional_timeout_, latchFunction_, optional_timeoutMessage_, this);
this.addToQueue(waitsForFunc);
return this;
Expand Down