Fix for jasmine.Spy.andCallThrough() and custom function props #258

wants to merge 1 commit into


None yet
3 participants

nohuhu commented Jul 20, 2012

When a function has object properties, calling spyOn() for that function may break other code that depend on those properties. This fix adds property replication to .andCallThrough(), which is assumed to make the spy "blend in" and follow original function behavior.


infews commented Aug 14, 2012

This is a known issue with Jasmine spies. There have been a couple of pull requests attempting to solve the problem.

Here's the Tracker story so you can follow its progress:
We expect to refactor spies a bit in an upcoming release and will include something like this feature.

Thanks for the work and thanks for using Jasmine!


ragaskar commented Sep 1, 2012

This seems like something we could take in advance of any spy refactoring if it checked for the property's existence on the spy itself before overwriting. That would prevent anyone from getting accidentally broken, but provide improved spy functionality.


infews commented Oct 26, 2012

Closing for now. Please follow Tracker for progress.

infews closed this Oct 26, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment