couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lena Herrmann <>
Subject Small changes to jquery.couch.js ajax method for better testing?
Date Mon, 29 Mar 2010 23:40:19 GMT

I think it is very bad style when you change code only in order to make 
it more testable. But I can't think of a way to test some methods 
without these small changes to jquery.couch.js:

Look at lines 33-35 and 37. Examples why the changes are needed are here:

The problem is that the details of the ajax request are encapsulated, 
which is a good thing. Whenever possible I try to test the results of 
the method and not its internals. But some methods only trigger 
something on couchdb, and it's hard or impossible to check the results 
(compact or cleanup view, for example).

1) Does someone have a better idea how to test the stuff, or

2) are these changes acceptable, or

3) are they not and the code should better stay untested?

What do you think?


View raw message