From a1610b0485969380bdc09cd411f0965c8c1569ce Mon Sep 17 00:00:00 2001 From: Nao Ohira Date: Mon, 19 Sep 2016 21:29:07 +0200 Subject: [PATCH] Add test for bulkDocs --- pouchdb-core/pouchdb-core-tests.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pouchdb-core/pouchdb-core-tests.ts b/pouchdb-core/pouchdb-core-tests.ts index b46bce834d..3da5e929b7 100644 --- a/pouchdb-core/pouchdb-core-tests.ts +++ b/pouchdb-core/pouchdb-core-tests.ts @@ -38,6 +38,23 @@ namespace PouchDBCoreTests { }); } + function testBulkDocs() { + const db = new PouchDB(); + type MyModel = { property: 'someProperty '}; + let model: PouchDB.Core.Document; + let model2: PouchDB.Core.Document; + + db.bulkDocs([model, model2]).then((result) => { + result.forEach(({ ok, id, rev }) => { + isString(id); + isString(rev); + }); + }); + + db.bulkDocs([model, model2], null, (error, response) => { + }); + } + function testCompact() { const db = new PouchDB<{}>(); // Promise version