Revert removal of compare nesting
Since we want the user to be able to pass a negative comparison function, the extra layer of wrapping is now needed
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
getJasmineRequireObj().toMatch = function() {
|
||||
|
||||
function toMatch() {
|
||||
return function(actual, expected) {
|
||||
var regexp = new RegExp(expected);
|
||||
return {
|
||||
compare: function(actual, expected) {
|
||||
var regexp = new RegExp(expected);
|
||||
|
||||
return {
|
||||
pass: regexp.test(actual)
|
||||
};
|
||||
return {
|
||||
pass: regexp.test(actual)
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user