0

I know I can see if a method of function was called and with which parameters. But is it possible to see which which functions called it? So in fact I would like to find out from where in my code a function is being called.

driechel
  • 3,393
  • 3
  • 21
  • 23
  • If you really need to find where in your code a function was called within a unit test, you have a problem and are about to have another one ;) – ggozad Aug 24 '12 at 17:51

1 Answers1

0

Not sure why you need to test this but you can mock the function you wanna call and use arguments.callee.caller inside the mocked function to get function that call your function.

Community
  • 1
  • 1
Andreas Köberle
  • 106,652
  • 57
  • 273
  • 297