If you are using javascript you could look at using Pouchdb to run a very 
simple preview of your functions.



On 01 Aug 2014, at 1:44 PM, Alexander Shorin <[email protected]> wrote:

> Hi,
> 
> Testing views/lists and others functions is simple, but currently will
> require some work from your side. Here is the plan:
> 1. You need a tool that implements query server protocol and
> communicates with it;
> 2. You need a middleware which will translate your function into ddoc
> (or takes yours one), pass it via query server protocol and return the
> result back in nicer form;
> 3. Finally, you need a target function/ddoc and challenges to apply.
> 4. Bonus: integrate all this with your favorite testing framework.
> 
> Hopefully, you don't need in first two points of this plan: you can
> try to reuse https://github.com/janl/couchdb-test-couchjs project and
> build your testing framework on top of it. And you'll be able to test
> your design functions without need to run CouchDB instance.
> 
> On other hand, you have alternative way to go by making tests inside
> couchapp and let CouchDB handle all the implementation details. To
> call the tests you only need to set some show function which will
> introspect the related design document, locate the tests, run them and
> print out result in nicer HTML page. As bonus you'll get self tested
> couchapps and verify their correctnesses in anytime you want.
> 
> --
> ,,,^..^,,,
> 
> 
> On Sun, Jul 27, 2014 at 9:54 PM, Conor Mac Aoidh
> <[email protected]> wrote:
>> Hi All,
>> 
>> Can anyone recommend a thorough method of testing couchdb view and list
>> functions?
>> 
>> I'm using Jasmine to run tests atm and I have tried using mock-couch to
>> emulate database behavior. However, AFAIK mock-couch does not support using
>> list functions.
>> 
>> I just want to have a testcase that I can run to verify my view and list
>> functions are working as expected.
>> 
>> Thanks
>> 
>> Conor

Reply via email to