File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,9 @@ describe('TLS Support', function () {
43
43
44
44
context ( 'when tls filepaths are provided' , ( ) => {
45
45
let client : MongoClient ;
46
+
46
47
afterEach ( async ( ) => {
47
- if ( client ) await client . close ( ) ;
48
+ await client ? .close ( ) ;
48
49
} ) ;
49
50
50
51
context ( 'when tls filepaths have length > 0' , ( ) => {
@@ -102,6 +103,18 @@ describe('TLS Support', function () {
102
103
expect ( err ) . to . be . instanceof ( Error ) ;
103
104
expect ( client . options ) . property ( 'crl' ) . to . exist ;
104
105
} ) ;
106
+
107
+ context ( 'when client has been opened and closed more than once' , function ( ) {
108
+ it ( 'should only read files once' , async ( ) => {
109
+ await client . connect ( ) ;
110
+ await client . close ( ) ;
111
+
112
+ const crlFileAccessTime = ( await fs . stat ( TLS_CRL_FILE ) ) . atime ;
113
+
114
+ await client . connect ( ) ;
115
+
116
+ expect ( ( await fs . stat ( TLS_CRL_FILE ) ) . atime ) . to . deep . equal ( crlFileAccessTime ) ;
117
+ } ) ;
105
118
} ) ;
106
119
} ) ;
107
120
You can’t perform that action at this time.
0 commit comments