katowulf / mockfirebase

Firebase mock library for writing unit tests (experimental)
157 stars 40 forks source link

Remove automatic addition of test spies #27

Closed bendrucker closed 9 years ago

bendrucker commented 9 years ago

This brings the test suite down to just over half a second versus almost a minute with enough CPU utilization to get my MacBook Pro's fans spinning. @katowulf I'd like to get this out ASAP as 0.4 and then consider whether there needs to be some special facility for attaching spies to child references in the future. I'll also jump over to AngularFire and write up a PR updating the tests for 0.4 that can be merged after release.

Closes #26

bendrucker commented 9 years ago

Just went and updated the AngularFire suite to reflect the removal of implicit spies in https://github.com/firebase/angularfire/pull/434

It took maybe 15 minutes, half of which was glancing at the Jasmine docs (have I mentioned how much I hate it? :smile:). I don't see a compelling reason to provide any sort of facility for automatically spying on methods right now. I'll probably actually remove all the spy related code entirely. It's certainly something to revisit in the future, but that should be based on real user needs and a more thorough look at perf issues.

bendrucker commented 9 years ago

@katowulf Will wait until later in the day to hear from you and then merge this. It'll be an opt-in upgrade anyway as a minor v0 release.

katowulf commented 9 years ago

Been sick since Sunday. I'm still hoping to poke around and make sure this is practical; I still have a nagging feeling that adding spies after the fact may be impossible in some scenarios. Please give this until Friday if that's practical; work is very busy at present and my time is sparse.

bendrucker commented 9 years ago

Feel better! I won't do anything until the end of the week. It may turn out to be the case that letting users handle this on their own. If that is indeed the case I think the best way to find that out is to do things the right (and simple way) and see if complexity is needed in the future.