jasminewd2
Advanced tools
Comparing version 0.0.7 to 0.0.8
# Changelog for jasminewd2 | ||
# 0.0.8 | ||
- ([5abc745](https://github.com/angular/protractor/commit/5abc7457cd73a4a4ba70b3c9ceeadac6d42bbd76)) | ||
chore(jasmine): update MatchFactory to allow message as function | ||
- ([750898c](https://github.com/angular/protractor/commit/750898c90a1cc1bef09384b60ef6e15adfe734f7)) | ||
fix(expectation): expectations without promises no longer add to task queue | ||
Instead, expectations without promises in either expected or actual are unchanged from the | ||
original Jasmine implementation. | ||
See https://github.com/angular/protractor/issues/2894 | ||
# 0.0.7 | ||
@@ -4,0 +17,0 @@ |
23
index.js
@@ -156,2 +156,4 @@ /** | ||
var originalWrapCompare = jasmine.Expectation.prototype.wrapCompare; | ||
/** | ||
@@ -169,7 +171,12 @@ * Creates a matcher wrapper that resolves any promises given for actual and | ||
webdriver.promise.when(expectation.actual).then(function(actual) { | ||
return webdriver.promise.all(expected).then(function(expected) { | ||
return compare(actual, expected); | ||
if (!webdriver.promise.isPromise(expectation.actual) && | ||
!webdriver.promise.isPromise(expected)) { | ||
originalWrapCompare(name, matcherFactory).apply(this, arguments); | ||
} else { | ||
webdriver.promise.when(expectation.actual).then(function(actual) { | ||
return webdriver.promise.all(expected).then(function(expected) { | ||
return compare(actual, expected); | ||
}); | ||
}); | ||
}); | ||
} | ||
@@ -190,3 +197,3 @@ function compare(actual, expected) { | ||
return webdriver.promise.when(result.pass).then(function(pass) { | ||
var message = ""; | ||
var message = ''; | ||
@@ -199,3 +206,7 @@ if (!pass) { | ||
} else { | ||
message = result.message; | ||
if (Object.prototype.toString.apply(result.message) === '[object Function]') { | ||
message = result.message(); | ||
} else { | ||
message = result.message; | ||
} | ||
} | ||
@@ -202,0 +213,0 @@ } |
@@ -16,4 +16,4 @@ { | ||
"jshint": "2.5.0", | ||
"jasmine": "2.3.2", | ||
"selenium-webdriver": "2.47.0" | ||
"jasmine": "2.4.1", | ||
"selenium-webdriver": "2.48.2" | ||
}, | ||
@@ -30,3 +30,3 @@ "repository": { | ||
"license": "MIT", | ||
"version": "0.0.7" | ||
"version": "0.0.8" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
242
13654
4
1
0