@@ -10,7 +10,7 @@ describe('ReadConcern', function() {
10
10
return setupDatabase ( configuration ) ;
11
11
} ) ;
12
12
13
- it ( 'Should set local readConcern on db level' , {
13
+ it ( 'Should set local readConcern on db level when using collection method ' , {
14
14
metadata : { requires : { topology : 'replicaset' , mongodb : '>= 3.2' } } ,
15
15
16
16
test : function ( done ) {
@@ -56,6 +56,31 @@ describe('ReadConcern', function() {
56
56
}
57
57
} ) ;
58
58
59
+ it ( 'Should set local readConcern on db level when using createCollection method' , {
60
+ metadata : { requires : { topology : 'replicaset' , mongodb : '>= 3.2' } } ,
61
+
62
+ test : function ( done ) {
63
+ // Get a new instance
64
+ const configuration = this . configuration ;
65
+ const client = configuration . newClient (
66
+ { w : 1 } ,
67
+ { poolSize : 1 , readConcern : { level : 'local' } }
68
+ ) ;
69
+ client . connect ( ( err , client ) => {
70
+ expect ( err ) . to . not . exist ;
71
+ const db = client . db ( configuration . db ) ;
72
+ expect ( db . s . readConcern ) . to . deep . equal ( { level : 'local' } ) ;
73
+
74
+ // Get a collection using createCollection
75
+ db . createCollection ( 'readConcernCollection' , ( err , collection ) => {
76
+ // Validate readConcern
77
+ expect ( collection . s . readConcern ) . to . deep . equal ( { level : 'local' } ) ;
78
+ client . close ( done ) ;
79
+ } ) ;
80
+ } ) ;
81
+ }
82
+ } ) ;
83
+
59
84
it ( 'Should set majority readConcern on db level' , {
60
85
metadata : { requires : { topology : 'replicaset' , mongodb : '>= 3.2' } } ,
61
86
0 commit comments