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

@@ -1,14 +1,17 @@
getJasmineRequireObj().SpyFactory = function(j$) {
function SpyFactory(getCustomStrategies, getDefaultStrategyFn) {
function SpyFactory(
getCustomStrategies,
getDefaultStrategyFn,
getMatchersUtil
) {
var self = this;
this.createSpy = function(name, originalFn) {
return j$.Spy(
name,
return j$.Spy(name, getMatchersUtil(), {
originalFn,
getCustomStrategies(),
getDefaultStrategyFn()
);
customStrategies: getCustomStrategies(),
defaultStrategyFn: getDefaultStrategyFn()
});
};
this.createSpyObj = function(baseName, methodNames, propertyNames) {