Skip to content

Instantly share code, notes, and snippets.

@daleharvey
Created February 21, 2014 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daleharvey/9132869 to your computer and use it in GitHub Desktop.
Save daleharvey/9132869 to your computer and use it in GitHub Desktop.
it('changes are not duplicated', function (done) {
var db = new PouchDB(dbs.name);
var called = 0;
var changes = db.changes({
since: 'latest',
continuous: true,
onChange: function () {
called++;
}
});
db.put({_id: 'adoc', key: 'value'});
setTimeout(function () {
called.should.equal(1);
changes.cancel();
done();
}, 1000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment