Skip to content

Commit a1cd1bf

Browse files
gr2mnolanlawson
authored andcommitted
test: fix "skips deleted docs" test
1 parent 4f5f6d0 commit a1cd1bf

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

test/test.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,19 +140,22 @@ function tests(dbName, dbType) {
140140
});
141141

142142
it('skips deleted docs', function () {
143-
db.transform({
144-
incoming: function (doc) {
145-
doc.foo.baz = 'baz';
146-
return doc;
147-
}
148-
});
149143
var doc = {_id: 'foo', foo: {}};
150144
return db.put(doc).then(function (res) {
151145
doc._rev = res.rev;
152146
return db.get('foo');
153147
}).then(function (doc) {
154-
doc.foo.baz.should.equal('baz');
155-
return db.remove(doc);
148+
var transformCalledOnDelete = false;
149+
db.transform({
150+
incoming: function (doc) {
151+
transformCalledOnDelete = true;
152+
return doc;
153+
}
154+
});
155+
156+
return db.remove(doc).then(function () {
157+
transformCalledOnDelete.should.equal(false);
158+
});
156159
});
157160
});
158161

0 commit comments

Comments
 (0)