Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jasminewd2

Package Overview
Dependencies
Maintainers
3
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jasminewd2 - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

README.md

8

CHANGELOG.md
# Changelog for jasminewd2
# 0.0.9
- ([790c81e](https://github.com/angular/protractor/commit/790c81eb0aba880fffbdcb4e834eb2161141620c))
fix(expectations): allow custom matchers to return a promise when actual is not a promise
See angular/protractor#2964
# 0.0.8

@@ -4,0 +12,0 @@

64

index.js

@@ -156,4 +156,2 @@ /**

var originalWrapCompare = jasmine.Expectation.prototype.wrapCompare;
/**

@@ -173,3 +171,3 @@ * Creates a matcher wrapper that resolves any promises given for actual and

!webdriver.promise.isPromise(expected)) {
originalWrapCompare(name, matcherFactory).apply(this, arguments);
compare(expectation.actual, expected);
} else {

@@ -196,33 +194,39 @@ webdriver.promise.when(expectation.actual).then(function(actual) {

return webdriver.promise.when(result.pass).then(function(pass) {
var message = '';
if (webdriver.promise.isPromise(result.pass)) {
return webdriver.promise.when(result.pass).then(compareDone);
} else {
return compareDone(result.pass);
}
if (!pass) {
if (!result.message) {
args.unshift(expectation.isNot);
args.unshift(name);
message = expectation.util.buildFailureMessage.apply(null, args);
} else {
if (Object.prototype.toString.apply(result.message) === '[object Function]') {
message = result.message();
} else {
message = result.message;
}
}
}
function compareDone(pass) {
var message = '';
if (expected.length == 1) {
expected = expected[0];
if (!pass) {
if (!result.message) {
args.unshift(expectation.isNot);
args.unshift(name);
message = expectation.util.buildFailureMessage.apply(null, args);
} else {
if (Object.prototype.toString.apply(result.message) === '[object Function]') {
message = result.message();
} else {
message = result.message;
}
}
var res = {
matcherName: name,
passed: pass,
message: message,
actual: actual,
expected: expected,
error: matchError
};
expectation.addExpectationResult(pass, res);
});
}
if (expected.length == 1) {
expected = expected[0];
}
var res = {
matcherName: name,
passed: pass,
message: message,
actual: actual,
expected: expected,
error: matchError
};
expectation.addExpectationResult(pass, res);
}
function defaultNegativeCompare() {

@@ -229,0 +233,0 @@ var result = matcher.compare.apply(null, args);

@@ -17,3 +17,3 @@ {

"jasmine": "2.4.1",
"selenium-webdriver": "2.48.2"
"selenium-webdriver": "2.52.0"
},

@@ -30,3 +30,3 @@ "repository": {

"license": "MIT",
"version": "0.0.8"
"version": "0.0.9"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc