Hi David,
I have tested your suggestions. Thank you. Here some comments:
- as suggested, spies in classical titanium, work, as suggested, without the the comment syntax. Anyway, at the beginning I was not able to let them work, because I was adding the addSpy call, BEFORE the object I want to spy, and for some reason this doesn't work. The spy works only if you declare AFTER the object you want to attach too. I don't know if this is a bug or how it should work, but from the docs, the // notations let me think to "annotation" or "decorator" of other programming language and framework, so I was natural to me to add it before. Anyway, using the // notation would be useful if after testing you would to deploy you don't need to manually remove all the spies in your files before deployment
- I have also tested out your alloy.jmk to tries spies in Alloy. I works well if you are manually pushing updates with ts run -u, but if you are going to use ts @ run -u, the tishadow server starts an infinite loop (cause controller files change during the pre:compiler task, when you inject the spy at the end of the file). Probably if one uses spies doesn't need too much the autoreload features, so we can live with this, but if you find a way to fix this, it would be great.
Anyway, can I always manually add the spy at the end of each controller with addSpy("controller_name", $) ? am I correct?
Thank you
Antonio