Use custom equality testers in Spy#withArgs

Fixes #1836.
This commit is contained in:
Steve Gravrock
2021-11-15 18:30:43 -08:00
parent 8e74529631
commit 2a049015b0
6 changed files with 152 additions and 61 deletions

View File

@@ -327,12 +327,18 @@ getJasmineRequireObj().Env = function(j$) {
};
var makeMatchersUtil = function() {
var customEqualityTesters =
runnableResources[currentRunnable().id].customEqualityTesters;
return new j$.MatchersUtil({
customTesters: customEqualityTesters,
pp: makePrettyPrinter()
});
const cr = currentRunnable();
if (cr) {
const customEqualityTesters =
runnableResources[cr.id].customEqualityTesters;
return new j$.MatchersUtil({
customTesters: customEqualityTesters,
pp: makePrettyPrinter()
});
} else {
return new j$.MatchersUtil({ pp: j$.basicPrettyPrinter_ });
}
};
var expectationFactory = function(actual, spec) {
@@ -863,7 +869,8 @@ getJasmineRequireObj().Env = function(j$) {
}
return undefined;
}
},
makeMatchersUtil
);
var spyRegistry = new j$.SpyRegistry({