iriscouch / follow

Very stable, very reliable, NodeJS CouchDB _changes follower
Apache License 2.0
393 stars 82 forks source link

How to write mocha unit testcase for db.follow() #85

Open Nagarjuna-S opened 8 years ago

Nagarjuna-S commented 8 years ago

We are using following code for cloudant changes.

var feed = db.follow({include_docs: true, since: "now"});
feed.filter = function (doc, req) {
    if (doc._deleted || doc.name === "test") {
        return true;
    }
    return false;
};
feed.on('change', function (change) {
    _artifactChange(change);
});

feed.follow();

We want to write mocha unit testcases for above code.. Please share us the samples if any one had already written mocha test cases..

Thanks