Skip to content

Commit b9d71ec

Browse files
committed
test: check crl access time
1 parent b25822a commit b9d71ec

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

test/manual/tls_support.test.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ describe('TLS Support', function () {
4343

4444
context('when tls filepaths are provided', () => {
4545
let client: MongoClient;
46+
4647
afterEach(async () => {
47-
if (client) await client.close();
48+
await client?.close();
4849
});
4950

5051
context('when tls filepaths have length > 0', () => {
@@ -102,6 +103,18 @@ describe('TLS Support', function () {
102103
expect(err).to.be.instanceof(Error);
103104
expect(client.options).property('crl').to.exist;
104105
});
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+
});
105118
});
106119
});
107120

0 commit comments

Comments
 (0)