@@ -34,10 +34,10 @@ const DOCID = 'doc1';
3434describe ( 'CloudantClient' , function ( ) {
3535 before ( function ( done ) {
3636 var mocks = nock ( SERVER )
37- . put ( DBNAME ) // create database
38- . reply ( 201 , { ok : true } )
39- . post ( DBNAME ) // create document
40- . reply ( 201 , { ok : true , id : DOCID , rev : '1-xxxxxxxx' } ) ;
37+ . put ( DBNAME ) // create database
38+ . reply ( 201 , { ok : true } )
39+ . post ( DBNAME ) // create document
40+ . reply ( 201 , { ok : true , id : DOCID , rev : '1-xxxxxxxx' } ) ;
4141
4242 var cloudantClient = new Client ( { plugins : 'retry' } ) ;
4343
@@ -70,8 +70,8 @@ describe('CloudantClient', function() {
7070
7171 after ( function ( done ) {
7272 var mocks = nock ( SERVER )
73- . delete ( DBNAME )
74- . reply ( 200 , { ok : true } ) ;
73+ . delete ( DBNAME )
74+ . reply ( 200 , { ok : true } ) ;
7575
7676 var cloudantClient = new Client ( { plugins : 'retry' } ) ;
7777
@@ -263,9 +263,9 @@ describe('CloudantClient', function() {
263263 }
264264
265265 var mocks = nock ( SERVER )
266- . get ( DBNAME )
267- . times ( 4 )
268- . reply ( 200 , { doc_count : 1 } ) ;
266+ . get ( DBNAME )
267+ . times ( 4 )
268+ . reply ( 200 , { doc_count : 1 } ) ;
269269
270270 var cloudantClient = new Client ( {
271271 maxAttempt : 5 ,
@@ -293,8 +293,8 @@ describe('CloudantClient', function() {
293293
294294 it ( 'after plugin execution phase #db' , function ( done ) {
295295 var mocks = nock ( SERVER )
296- . get ( DBNAME )
297- . reply ( 200 , { doc_count : 1 } ) ;
296+ . get ( DBNAME )
297+ . reply ( 200 , { doc_count : 1 } ) ;
298298
299299 var cloudantClient = new Client ( { plugins : [ ] } ) ;
300300 assert . equal ( cloudantClient . _plugins . length , 0 ) ;
@@ -320,8 +320,8 @@ describe('CloudantClient', function() {
320320 describe ( 'with no plugins' , function ( ) {
321321 it ( 'performs request and returns response' , function ( done ) {
322322 var mocks = nock ( SERVER )
323- . get ( DBNAME )
324- . reply ( 200 , { doc_count : 1 } ) ;
323+ . get ( DBNAME )
324+ . reply ( 200 , { doc_count : 1 } ) ;
325325
326326 var cloudantClient = new Client ( { plugins : [ ] } ) ;
327327 assert . equal ( cloudantClient . _plugins . length , 0 ) ;
@@ -346,8 +346,8 @@ describe('CloudantClient', function() {
346346 }
347347
348348 var mocks = nock ( SERVER )
349- . get ( DBNAME )
350- . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } ) ;
349+ . get ( DBNAME )
350+ . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } ) ;
351351
352352 var cloudantClient = new Client ( { plugins : [ ] } ) ;
353353 assert . equal ( cloudantClient . _plugins . length , 0 ) ;
@@ -367,11 +367,11 @@ describe('CloudantClient', function() {
367367
368368 it ( 'performs request with piped payload and returns response' , function ( done ) {
369369 var mocks = nock ( SERVER )
370- . post ( DBNAME + '/_all_docs' , function ( body ) {
371- assert . deepEqual ( body , { keys : [ 'doc1' ] } ) ;
372- return true ;
373- } )
374- . reply ( 200 , { rows : [ { key : 'doc1' , value : { rev : '1-xxxxxxxx' } } ] } ) ;
370+ . post ( DBNAME + '/_all_docs' , function ( body ) {
371+ assert . deepEqual ( body , { keys : [ 'doc1' ] } ) ;
372+ return true ;
373+ } )
374+ . reply ( 200 , { rows : [ { key : 'doc1' , value : { rev : '1-xxxxxxxx' } } ] } ) ;
375375
376376 var cloudantClient = new Client ( { plugins : [ ] } ) ;
377377 assert . equal ( cloudantClient . _plugins . length , 0 ) ;
@@ -399,8 +399,8 @@ describe('CloudantClient', function() {
399399 describe ( 'with single Noop plugin' , function ( ) {
400400 it ( 'performs request and calls request and response hooks only' , function ( done ) {
401401 var mocks = nock ( SERVER )
402- . get ( DBNAME )
403- . reply ( 200 , { doc_count : 1 } ) ;
402+ . get ( DBNAME )
403+ . reply ( 200 , { doc_count : 1 } ) ;
404404
405405 var cloudantClient = new Client ( { plugins : [ ] } ) ;
406406 cloudantClient . _addPlugins ( testPlugin . NoopPlugin ) ;
@@ -427,11 +427,11 @@ describe('CloudantClient', function() {
427427
428428 it ( 'performs request with piped payload and returns response' , function ( done ) {
429429 var mocks = nock ( SERVER )
430- . post ( DBNAME + '/_all_docs' , function ( body ) {
431- assert . deepEqual ( body , { keys : [ 'doc1' ] } ) ;
432- return true ;
433- } )
434- . reply ( 200 , { rows : [ { key : 'doc1' , value : { rev : '1-xxxxxxxx' } } ] } ) ;
430+ . post ( DBNAME + '/_all_docs' , function ( body ) {
431+ assert . deepEqual ( body , { keys : [ 'doc1' ] } ) ;
432+ return true ;
433+ } )
434+ . reply ( 200 , { rows : [ { key : 'doc1' , value : { rev : '1-xxxxxxxx' } } ] } ) ;
435435
436436 var cloudantClient = new Client ( { plugins : [ ] } ) ;
437437 cloudantClient . _addPlugins ( testPlugin . NoopPlugin ) ;
@@ -462,8 +462,8 @@ describe('CloudantClient', function() {
462462 }
463463
464464 var mocks = nock ( SERVER )
465- . get ( DBNAME )
466- . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } ) ;
465+ . get ( DBNAME )
466+ . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } ) ;
467467
468468 var cloudantClient = new Client ( { plugins : [ ] } ) ;
469469 cloudantClient . _addPlugins ( testPlugin . NoopPlugin ) ;
@@ -490,8 +490,8 @@ describe('CloudantClient', function() {
490490 describe ( 'with multiple Noop plugins' , function ( ) {
491491 it ( 'performs request and calls request and response hooks only' , function ( done ) {
492492 var mocks = nock ( SERVER )
493- . get ( DBNAME )
494- . reply ( 200 , { doc_count : 1 } ) ;
493+ . get ( DBNAME )
494+ . reply ( 200 , { doc_count : 1 } ) ;
495495
496496 var cloudantClient = new Client ( { plugins : [ ] } ) ;
497497 cloudantClient . _addPlugins ( testPlugin . NoopPlugin1 ) ; // plugin 1
@@ -522,11 +522,11 @@ describe('CloudantClient', function() {
522522
523523 it ( 'performs request with piped payload and returns response' , function ( done ) {
524524 var mocks = nock ( SERVER )
525- . post ( DBNAME + '/_all_docs' , function ( body ) {
526- assert . deepEqual ( body , { keys : [ 'doc1' ] } ) ;
527- return true ;
528- } )
529- . reply ( 200 , { rows : [ { key : 'doc1' , value : { rev : '1-xxxxxxxx' } } ] } ) ;
525+ . post ( DBNAME + '/_all_docs' , function ( body ) {
526+ assert . deepEqual ( body , { keys : [ 'doc1' ] } ) ;
527+ return true ;
528+ } )
529+ . reply ( 200 , { rows : [ { key : 'doc1' , value : { rev : '1-xxxxxxxx' } } ] } ) ;
530530
531531 var cloudantClient = new Client ( { plugins : [ ] } ) ;
532532 cloudantClient . _addPlugins ( testPlugin . NoopPlugin1 ) ; // plugin 1
@@ -559,8 +559,8 @@ describe('CloudantClient', function() {
559559 }
560560
561561 var mocks = nock ( SERVER )
562- . get ( DBNAME )
563- . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } ) ;
562+ . get ( DBNAME )
563+ . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } ) ;
564564
565565 var cloudantClient = new Client ( { plugins : [ ] } ) ;
566566 cloudantClient . _addPlugins ( testPlugin . NoopPlugin1 ) ; // plugin 1
@@ -637,8 +637,8 @@ describe('CloudantClient', function() {
637637 }
638638
639639 var mocks = nock ( SERVER )
640- . put ( DBNAME ) . times ( 10 )
641- . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } ) ;
640+ . put ( DBNAME ) . times ( 10 )
641+ . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } ) ;
642642
643643 var cloudantClient = new Client ( { maxAttempt : 10 , plugins : [ ] } ) ;
644644 cloudantClient . _addPlugins ( testPlugin . ComplexPlugin1 ) ;
@@ -707,10 +707,10 @@ describe('CloudantClient', function() {
707707 }
708708
709709 var mocks = nock ( SERVER )
710- . get ( DBNAME )
711- . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } )
712- . get ( '/bar' )
713- . reply ( 200 , { ok : true } ) ;
710+ . get ( DBNAME )
711+ . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } )
712+ . get ( '/bar' )
713+ . reply ( 200 , { ok : true } ) ;
714714
715715 var cloudantClient = new Client ( { maxAttempt : 10 , plugins : [ ] } ) ;
716716 cloudantClient . _addPlugins ( testPlugin . ComplexPlugin2 ) ;
@@ -779,8 +779,8 @@ describe('CloudantClient', function() {
779779 }
780780
781781 var mocks = nock ( SERVER )
782- . get ( DBNAME )
783- . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } ) ;
782+ . get ( DBNAME )
783+ . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } ) ;
784784
785785 var cloudantClient = new Client ( { maxAttempt : 10 , plugins : [ ] } ) ;
786786 cloudantClient . _addPlugins ( testPlugin . ComplexPlugin3 ) ;
@@ -872,8 +872,8 @@ describe('CloudantClient', function() {
872872 describe ( 'with no plugins' , function ( ) {
873873 it ( 'performs request and returns response' , function ( done ) {
874874 var mocks = nock ( SERVER )
875- . get ( DBNAME )
876- . reply ( 200 , { doc_count : 1 } ) ;
875+ . get ( DBNAME )
876+ . reply ( 200 , { doc_count : 1 } ) ;
877877
878878 var cloudantClient = new Client ( { plugins : [ ] } ) ;
879879 assert . equal ( cloudantClient . _plugins . length , 0 ) ;
@@ -905,8 +905,8 @@ describe('CloudantClient', function() {
905905 }
906906
907907 var mocks = nock ( SERVER )
908- . get ( DBNAME )
909- . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } ) ;
908+ . get ( DBNAME )
909+ . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } ) ;
910910
911911 var cloudantClient = new Client ( { plugins : [ ] } ) ;
912912 assert . equal ( cloudantClient . _plugins . length , 0 ) ;
@@ -929,8 +929,8 @@ describe('CloudantClient', function() {
929929 describe ( 'with single Noop plugin' , function ( ) {
930930 it ( 'performs request and calls request and response hooks only' , function ( done ) {
931931 var mocks = nock ( SERVER )
932- . get ( DBNAME )
933- . reply ( 200 , { doc_count : 1 } ) ;
932+ . get ( DBNAME )
933+ . reply ( 200 , { doc_count : 1 } ) ;
934934
935935 var cloudantClient = new Client ( { plugins : [ ] } ) ;
936936 cloudantClient . _addPlugins ( testPlugin . NoopPlugin ) ;
@@ -966,8 +966,8 @@ describe('CloudantClient', function() {
966966 }
967967
968968 var mocks = nock ( SERVER )
969- . get ( DBNAME )
970- . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } ) ;
969+ . get ( DBNAME )
970+ . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } ) ;
971971
972972 var cloudantClient = new Client ( { plugins : [ ] } ) ;
973973 cloudantClient . _addPlugins ( testPlugin . NoopPlugin ) ;
@@ -995,8 +995,8 @@ describe('CloudantClient', function() {
995995 describe ( 'with multiple Noop plugins' , function ( ) {
996996 it ( 'performs request and calls request and response hooks only' , function ( done ) {
997997 var mocks = nock ( SERVER )
998- . get ( DBNAME )
999- . reply ( 200 , { doc_count : 1 } ) ;
998+ . get ( DBNAME )
999+ . reply ( 200 , { doc_count : 1 } ) ;
10001000
10011001 var cloudantClient = new Client ( { plugins : [ ] } ) ;
10021002 cloudantClient . _addPlugins ( testPlugin . NoopPlugin1 ) ; // plugin 1
@@ -1034,8 +1034,8 @@ describe('CloudantClient', function() {
10341034 }
10351035
10361036 var mocks = nock ( SERVER )
1037- . get ( DBNAME )
1038- . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } ) ;
1037+ . get ( DBNAME )
1038+ . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } ) ;
10391039
10401040 var cloudantClient = new Client ( { plugins : [ ] } ) ;
10411041 cloudantClient . _addPlugins ( testPlugin . NoopPlugin1 ) ; // plugin 1
@@ -1119,8 +1119,8 @@ describe('CloudantClient', function() {
11191119 }
11201120
11211121 var mocks = nock ( SERVER )
1122- . put ( DBNAME ) . times ( 10 )
1123- . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } ) ;
1122+ . put ( DBNAME ) . times ( 10 )
1123+ . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } ) ;
11241124
11251125 var cloudantClient = new Client ( { maxAttempt : 10 , plugins : [ ] } ) ;
11261126 cloudantClient . _addPlugins ( testPlugin . ComplexPlugin1 ) ;
@@ -1196,10 +1196,10 @@ describe('CloudantClient', function() {
11961196 }
11971197
11981198 var mocks = nock ( SERVER )
1199- . get ( DBNAME )
1200- . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } )
1201- . get ( '/bar' )
1202- . reply ( 200 , { ok : true } ) ;
1199+ . get ( DBNAME )
1200+ . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } )
1201+ . get ( '/bar' )
1202+ . reply ( 200 , { ok : true } ) ;
12031203
12041204 var cloudantClient = new Client ( { maxAttempt : 10 , plugins : [ ] } ) ;
12051205 cloudantClient . _addPlugins ( testPlugin . ComplexPlugin2 ) ;
@@ -1278,8 +1278,8 @@ describe('CloudantClient', function() {
12781278 }
12791279
12801280 var mocks = nock ( SERVER )
1281- . get ( DBNAME )
1282- . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } ) ;
1281+ . get ( DBNAME )
1282+ . replyWithError ( { code : 'ECONNRESET' , message : 'socket hang up' } ) ;
12831283
12841284 var cloudantClient = new Client ( { maxAttempt : 10 , plugins : [ ] } ) ;
12851285 cloudantClient . _addPlugins ( testPlugin . ComplexPlugin3 ) ;
0 commit comments