@@ -334,54 +334,55 @@ adapters.forEach((adapter) => {
334334
335335 it ( '#2935 new_edits=false with single unauthorized' , async ( ) => {
336336
337- const isCouchDB = await testUtils . isCouchDB ( ) ;
338- if ( adapter !== 'http' || ! isCouchDB ) {
339- return ;
340- }
337+ testUtils . isCouchDB ( async ( isCouchDB ) => {
338+ if ( adapter !== 'http' || ! isCouchDB ) {
339+ return ;
340+ }
341341
342- const ddoc = {
343- "_id" : "_design/validate" ,
344- "validate_doc_update" : function ( newDoc ) {
345- if ( newDoc . foo === undefined ) {
346- throw { unauthorized : 'Document must have a foo.' } ;
347- }
348- } . toString ( )
349- } ;
342+ const ddoc = {
343+ "_id" : "_design/validate" ,
344+ "validate_doc_update" : function ( newDoc ) {
345+ if ( newDoc . foo === undefined ) {
346+ throw { unauthorized : 'Document must have a foo.' } ;
347+ }
348+ } . toString ( )
349+ } ;
350350
351- const db = new PouchDB ( dbs . name ) ;
351+ const db = new PouchDB ( dbs . name ) ;
352352
353- await db . put ( ddoc ) ;
354- const res = await db . bulkDocs ( {
355- docs : [
356- {
357- '_id' : 'doc0' ,
358- '_rev' : '1-x' ,
359- 'foo' : 'bar' ,
360- '_revisions' : {
361- 'start' : 1 ,
362- 'ids' : [ 'x' ]
363- }
364- } , {
365- '_id' : 'doc1' ,
366- '_rev' : '1-x' ,
367- '_revisions' : {
368- 'start' : 1 ,
369- 'ids' : [ 'x' ]
353+ await db . put ( ddoc ) ;
354+ const res = await db . bulkDocs ( {
355+ docs : [
356+ {
357+ '_id' : 'doc0' ,
358+ '_rev' : '1-x' ,
359+ 'foo' : 'bar' ,
360+ '_revisions' : {
361+ 'start' : 1 ,
362+ 'ids' : [ 'x' ]
363+ }
364+ } , {
365+ '_id' : 'doc1' ,
366+ '_rev' : '1-x' ,
367+ '_revisions' : {
368+ 'start' : 1 ,
369+ 'ids' : [ 'x' ]
370+ }
371+ } , {
372+ '_id' : 'doc2' ,
373+ '_rev' : '1-x' ,
374+ 'foo' : 'bar' ,
375+ '_revisions' : {
376+ 'start' : 1 ,
377+ 'ids' : [ 'x' ]
378+ }
370379 }
371- } , {
372- '_id' : 'doc2' ,
373- '_rev' : '1-x' ,
374- 'foo' : 'bar' ,
375- '_revisions' : {
376- 'start' : 1 ,
377- 'ids' : [ 'x' ]
378- }
379- }
380- ]
381- } , { new_edits : false } ) ;
382- res . should . have . length ( 1 ) ;
383- should . exist ( res [ 0 ] . error ) ;
384- res [ 0 ] . id . should . equal ( 'doc1' ) ;
380+ ]
381+ } , { new_edits : false } ) ;
382+ res . should . have . length ( 1 ) ;
383+ should . exist ( res [ 0 ] . error ) ;
384+ res [ 0 ] . id . should . equal ( 'doc1' ) ;
385+ } ) ;
385386 } ) ;
386387
387388 it ( 'Deleting _local docs with bulkDocs' , async ( ) => {
0 commit comments