derbyjs / racer

Realtime model synchronization engine for Node.js
1.19k stars 118 forks source link

Enable RemoteDoc unit testing, including event checking for move #174

Closed woodcoder closed 10 years ago

woodcoder commented 10 years ago

This pull request contains an attempt to unit test RemoteDocs.

In particular, I'm attempting to show what I believe is incorrect array move event reporting, as discussed here: https://groups.google.com/d/msg/derbyjs/cPG3XO0kAwE/TvBA89f0ceUJ

There are currently 10 failures, but I'm keen to know whether this approach looks right!

nateps commented 10 years ago

Hey! Thanks for doing this. I'd been meaning to get these tests running against RemoteDoc for a while, and this is a great contribution.

Looks like all of your move tests are now passing for me, but there are definitely other tests that are failing.

nateps commented 10 years ago

I merged this after making modifications, because the tests were good. However, I reverted the changes to RemoteDoc and events. In the case of RemoteDoc moves, the bug was actually just something else, and there was a better fix to the events matching array indices, since the test segments could be cast upfront and the test at event emission time can remain simpler.

Thanks for the contribution! This helped me to find and fix a number of bugs in Racer

woodcoder commented 10 years ago

That's great news -- I look forward to trying the 'proper' fixes. Thanks for a great bit of code!