Merge branch '5.99' into 6.0
This commit is contained in:
27
src/core/asymmetric_equality/AllOf.js
Normal file
27
src/core/asymmetric_equality/AllOf.js
Normal file
@@ -0,0 +1,27 @@
|
||||
getJasmineRequireObj().AllOf = function(j$) {
|
||||
function AllOf() {
|
||||
const expectedValues = Array.from(arguments);
|
||||
if (expectedValues.length === 0) {
|
||||
throw new TypeError(
|
||||
'jasmine.allOf() expects at least one argument to be passed.'
|
||||
);
|
||||
}
|
||||
this.expectedValues = expectedValues;
|
||||
}
|
||||
|
||||
AllOf.prototype.asymmetricMatch = function(other, matchersUtil) {
|
||||
for (const expectedValue of this.expectedValues) {
|
||||
if (!matchersUtil.equals(other, expectedValue)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
AllOf.prototype.jasmineToString = function(pp) {
|
||||
return '<jasmine.allOf(' + pp(this.expectedValues) + ')>';
|
||||
};
|
||||
|
||||
return AllOf;
|
||||
};
|
||||
Reference in New Issue
Block a user