chris-l / mock-couch

A node.js module designed to mock a CouchDB server, mostly for unit testing purposes.
http://chris-l.github.io/mock-couch/
67 stars 44 forks source link

_changes mock #1

Closed jcrugzz closed 9 years ago

jcrugzz commented 10 years ago

Just came across this project, I am so glad this exists. Anything that requires having more than one couch becomes real annoying to test. Specifically I've been wanting something like this in order to write some tests for overwatch. I'd love to help out with a basic _changes implementation when I have some bandwidth. Let me know if this interests you :).

chris-l commented 10 years ago

Well, I'm glad that you like it! And of course I would be interested in a _changes implementation.

For the way is working (the this.databases is only an object whose properties are the databases), I guess it would make sense if the changes are saved like an array stored as property of each database, and directly naming that property as _changes. But other possible way would be to save each change directly on the document where it was made, under some property named with a magic string. I think the first way is easier and probably better, but I'm not sure. What you think?

Well, thanks a lot for the interest ;)

chris-l commented 9 years ago

Implemented here: #8.