Skip to content

Commit

Permalink
style: remove "uri" value when only used once
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed Oct 12, 2020
1 parent 13f3f1d commit 150494e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@ describe('multi-member replica set', () => {
it('should enter running state', async () => {
const replSet = await MongoMemoryReplSet.create({ replSet: { count: 3 } });
expect(replSet.servers.length).toEqual(3);
const uri = replSet.getUri();
expect(uri.split(',').length).toEqual(3);
expect(replSet.getUri().split(',').length).toEqual(3);

await replSet.stop();
}, 40000);

it('should be possible to connect replicaset after waitUntilRunning resolveds', async () => {
const replSet = await MongoMemoryReplSet.create({ replSet: { count: 3 } });
const uri = replSet.getUri();

const con = await MongoClient.connect(uri, {
const con = await MongoClient.connect(replSet.getUri(), {
useNewUrlParser: true,
useUnifiedTopology: true,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 600000;
describe('single server replset', () => {
it('should enter running state', async () => {
const replSet = await MongoMemoryReplSet.create();
const uri = replSet.getUri();
expect(uri.split(',').length).toEqual(1);
expect(replSet.getUri().split(',').length).toEqual(1);

await replSet.stop();
});
Expand All @@ -32,9 +31,8 @@ describe('single server replset', () => {

it('should be possible to connect replicaset after waitUntilRunning resolves', async () => {
const replSet = await MongoMemoryReplSet.create();
const uri = replSet.getUri();

const con = await MongoClient.connect(`${uri}?replicaSet=testset`, {
const con = await MongoClient.connect(replSet.getUri(), {
useNewUrlParser: true,
useUnifiedTopology: true,
});
Expand Down

0 comments on commit 150494e

Please sign in to comment.