Skip to content

Commit 3155bcc

Browse files
author
Thomas Reggi
authored
test: ensure connection with sharded topology
NODE-2827
1 parent 1aecf96 commit 3155bcc

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
'use strict';
2+
3+
const withClient = require('./shared').withClient;
4+
const setupDatabase = require('./shared').setupDatabase;
5+
const expect = require('chai').expect;
6+
const TopologyType = require('../../lib/sdam/common').TopologyType;
7+
8+
describe('Sharding (Connection)', function () {
9+
before(function () {
10+
return setupDatabase(this.configuration);
11+
});
12+
13+
it('Should use sharded topology', {
14+
metadata: { requires: { topology: 'sharded' } },
15+
test: function () {
16+
const client = this.configuration.newClient({});
17+
return withClient(client, (client, done) => {
18+
expect(client).to.exist;
19+
expect(client).nested.property('topology.description.type').to.equal(TopologyType.Sharded);
20+
return done();
21+
})();
22+
}
23+
});
24+
});

0 commit comments

Comments
 (0)