Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

(#635) - compact deleted document (test)

Added test so we make sure that also deleted document get compacted
  • Loading branch information...
commit dc3c5bc44700cfc7a4231302ac3d3cf5141dd565 1 parent 2c2f595
Tomasz Kołodziejski authored
Showing with 17 additions and 0 deletions.
  1. +17 −0 tests/test.compaction.js
17 tests/test.compaction.js
View
@@ -196,6 +196,23 @@ adapters.map(function(adapter) {
});
});
+ asyncTest('Compact deleted document', function() {
+ initTestDB(this.name, function(err, db) {
+ db.put({_id: "foo"}, function(err, res) {
+ var firstRev = res.rev;
+ db.remove({_id: "foo", _rev: firstRev}, function(err, res) {
+ db.compact(function() {
+ db.get("foo", {rev: firstRev}, function(err, res) {
+ ok(err, "got error");
+ strictEqual(err.reason, "missing", "correct reason");
+ start();
+ });
+ });
+ });
+ });
+ });
+ });
+
if (autoCompactionAdapters.indexOf(adapter) > -1) {
asyncTest('Auto-compaction test', function() {
initTestDB(this.name, {auto_compaction: true}, function(err, db) {
Please sign in to comment.
Something went wrong with that request. Please try again.