jasmine-enzyme
Advanced tools
Comparing version 3.6.1 to 3.7.0
@@ -17,10 +17,12 @@ 'use strict'; | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /** | ||
* This source code is licensed under the MIT-style license found in the | ||
* LICENSE file in the root directory of this source tree. * | ||
* | ||
* @providesModule JasmineEnzyme | ||
* | ||
*/ | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } /** | ||
* This source code is licensed under the MIT-style license found in the | ||
* LICENSE file in the root directory of this source tree. * | ||
* | ||
* @providesModule JasmineEnzyme | ||
* | ||
*/ | ||
function jasmineEnzyme() { | ||
@@ -39,3 +41,41 @@ // Migration step for moving people from jasmine-enzyme | ||
}; | ||
return { compare: matcherFn.bind({ equals: equals }) }; | ||
return { | ||
compare: function compare() { | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
var results = matcherFn.call.apply(matcherFn, [{ equals: equals }].concat(_toConsumableArray(args))); | ||
if (results.contextualInformation.actual) { | ||
results.message += '\nexpected: ' + results.contextualInformation.actual; | ||
} | ||
if (results.contextualInformation.expected) { | ||
results.message += '\nreceived: ' + results.contextualInformation.expected; | ||
} | ||
return results; | ||
}, | ||
negativeCompare: function negativeCompare() { | ||
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
args[_key2] = arguments[_key2]; | ||
} | ||
var results = matcherFn.call.apply(matcherFn, [{ equals: equals }].concat(_toConsumableArray(args))); | ||
if (results.contextualInformation.actual) { | ||
results.negatedMessage += '\nexpected: ' + results.contextualInformation.actual; | ||
} | ||
if (results.contextualInformation.expected) { | ||
results.negatedMessage += '\nreceived: ' + results.contextualInformation.expected; | ||
} | ||
return { | ||
pass: !results.pass, | ||
message: results.negatedMessage | ||
}; | ||
} | ||
}; | ||
}; | ||
@@ -42,0 +82,0 @@ }; |
{ | ||
"name": "jasmine-enzyme", | ||
"version": "3.6.1", | ||
"version": "3.7.0", | ||
"description": "Jasmine assertions for enzyme", | ||
@@ -47,6 +47,6 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"enzyme-matchers": "^3.6.1" | ||
"enzyme-matchers": "^3.7.0" | ||
}, | ||
"jest": { | ||
"testPathDirs": [ | ||
"roots": [ | ||
"<rootDir>/src" | ||
@@ -53,0 +53,0 @@ ], |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
11778
101
Updatedenzyme-matchers@^3.7.0