Skip to content

Commit 732aa5f

Browse files
committed
refactor: update to async/await
1 parent 1fafe23 commit 732aa5f

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

tests/integration/test.bulk_docs.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -332,11 +332,11 @@ adapters.forEach((adapter) => {
332332
await db.bulkDocs([doc]);
333333
});
334334

335-
it('#2935 new_edits=false with single unauthorized', function (done) {
335+
it('#2935 new_edits=false with single unauthorized', async () => {
336336

337-
testUtils.isCouchDB(function (isCouchDB) {
337+
testUtils.isCouchDB(async (isCouchDB) => {
338338
if (adapter !== 'http' || !isCouchDB) {
339-
return done();
339+
return Promise.resolve();
340340
}
341341

342342
const ddoc = {
@@ -350,9 +350,9 @@ adapters.forEach((adapter) => {
350350

351351
const db = new PouchDB(dbs.name);
352352

353-
db.put(ddoc).then(() => {
354-
return db.bulkDocs({
355-
docs: [
353+
await db.put(ddoc);
354+
const res = await db.bulkDocs({
355+
docs: [
356356
{
357357
'_id': 'doc0',
358358
'_rev': '1-x',
@@ -379,13 +379,10 @@ adapters.forEach((adapter) => {
379379
}
380380
]
381381
}, {new_edits: false});
382-
}).then((res) => {
383382
res.should.have.length(1);
384383
should.exist(res[0].error);
385384
res[0].id.should.equal('doc1');
386-
done();
387-
}).catch(done);
388-
});
385+
});
389386
});
390387

391388
it('Deleting _local docs with bulkDocs' , async () => {

0 commit comments

Comments
 (0)