Open Tischi86 opened 7 years ago
Requires test cases
Hey @ocramius,
could you maybe help to get this merged by suggesting a sane way to test this? We discussed this internally, and could not really decide on a way to test this that brings a real benefit at an acceptable cost. :)
Greetings from Witten!
@hco, here you created a command that just use the library appropriately. So your test should make sure that when the command is used, the appropriate calls are passed to it with the corresponding options.
You can do that by mocking the library and assert the calls and options passed to the mock. The issue here is that you need to mock the getHelper() method and all the objects that you use to get the mongoDb client before you can test what is passed to it but it's doable.
In my opinion a test that mocks away nearly all calls does not really have any benefit.
An integration test that would actually talk to CouchDB would make sense - is there any infrastructure for this?
Added a command to compact all couchDB views