Skip to content

Commit

Permalink
(pouchdb#4372) Fixing the test for auto compaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Genoud committed Feb 4, 2016
1 parent dab8455 commit 7a69326
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/integration/test.bulk_docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,11 @@ adapters.forEach(function (adapter) {

var db = new PouchDB(dbs.name, {revs_limit: 2});

// old revisions are always deleted with auto compaction
if (db.auto_compaction) {
return done();
}

var revs = [];
db.put({v: 1}, 'doc').then(function (v1) {
revs.push(v1.rev);
Expand All @@ -1016,6 +1021,8 @@ adapters.forEach(function (adapter) {
// the v2 revision is still in the db
return db.get('doc', {rev: revs[1]});
}).then(function (v2) {
v2.v.should.equal(2);

return db.get('doc', {rev: revs[0]}).then(function (v1) {
// the v1 revision is not in the db anymore
done(new Error('v1 should be missing'));
Expand Down

0 comments on commit 7a69326

Please sign in to comment.