mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
Merge pull request #17351 from atom/improve-message-when-test-fails-due-to-timeout
Provide more context when test fails due to timeout in `waitsFor`
This commit is contained in:
8
vendor/jasmine.js
vendored
8
vendor/jasmine.js
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user