Skip to content

Commit cf1cd34

Browse files
authored
chore(isPromise): revert expose deferred object's promise (#78)
1 parent ed2d3e8 commit cf1cd34

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

index.js

+5-21
Original file line numberDiff line numberDiff line change
@@ -205,28 +205,12 @@ jasmine.Expectation.prototype.wrapCompare = function(name, matcherFactory) {
205205

206206
matchError.stack = matchError.stack.replace(/ +at.+jasminewd.+\n/, '');
207207

208-
var actualValue = null;
209-
var expectedValue = null;
210-
211-
// Check to see if the value is of type webdriver.promise.Deferred
212-
// since deferred is not a promise.
213-
if (expectation.actual instanceof webdriver.promise.Deferred) {
214-
actualValue = expectation.actual.promise;
215-
} else {
216-
actualValue = expectation.actual;
217-
}
218-
if (expected instanceof webdriver.promise.Deferred) {
219-
expectedValue = expected.promise;
220-
} else {
221-
expectedValue = expected;
222-
}
223-
224-
if (!webdriver.promise.isPromise(actualValue) &&
225-
!webdriver.promise.isPromise(expectedValue)) {
226-
compare(actualValue, expectedValue);
208+
if (!webdriver.promise.isPromise(expectation.actual) &&
209+
!webdriver.promise.isPromise(expected)) {
210+
compare(expectation.actual, expected);
227211
} else {
228-
webdriver.promise.when(actualValue).then(function(actual) {
229-
return webdriver.promise.all(expectedValue).then(function(expected) {
212+
webdriver.promise.when(expectation.actual).then(function(actual) {
213+
return webdriver.promise.all(expected).then(function(expected) {
230214
return compare(actual, expected);
231215
});
232216
});

0 commit comments

Comments
 (0)