Cache redesign part 2

This commit is contained in:
Art Lowel
2021-01-20 14:34:08 +01:00
parent 64ba6293c9
commit c66de4fe91
155 changed files with 1610 additions and 1637 deletions

View File

@@ -95,3 +95,16 @@ export function createRequestEntry$(unCacheableObject?: UnCacheableObject, statu
lastUpdated: new Date().getTime()
});
}
/**
* Get the argument (method parameter) a Spy method got called with first
* Example case:
* - We spy on method mock(testNumber: number)
* - During the tests, mock gets called 3 times with numbers 8, 5 and 7
* - This function will return 8, as it's the first number mock got called with
* @param spyMethod The method that got spied on
* @param argumentIndex The index of the argument, only necessary if the spy method contains more than one parameter
*/
export function getFirstUsedArgumentOfSpyMethod(spyMethod: jasmine.Spy, argumentIndex: number = 0): any {
return spyMethod.calls.argsFor(0)[argumentIndex];
}