Spy on nested function jasmine. To spy on the accessors for the foo property, do:.