Skip to content

Commit b1fca16

Browse files
committed
chore: remove old option usages from tests
1 parent 54c456b commit b1fca16

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+863
-2192
lines changed

test/disabled/authentication.test.js

Lines changed: 45 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ describe('Authentication', function () {
6565

6666
// restart server
6767
configuration.manager.restart(true).then(function () {
68-
var client = new MongoClient(
69-
new Server(configuration.host, configuration.port, { auto_reconnect: true }),
70-
{ w: 1 }
71-
);
68+
var client = new MongoClient(new Server(configuration.host, configuration.port), { w: 1 });
7269
client.connect(function (err, client) {
7370
test.equal(null, err);
7471
var db = client.db(configuration.db);
@@ -77,10 +74,12 @@ describe('Authentication', function () {
7774
test.equal(null, err);
7875
client.close();
7976

80-
var client1 = new MongoClient(
81-
new Server(configuration.host, configuration.port, { auto_reconnect: true }),
82-
{ w: 1, user: 'admin', password: 'admin', authMechanism: 'SCRAM-SHA-1' }
83-
);
77+
var client1 = new MongoClient(new Server(configuration.host, configuration.port), {
78+
w: 1,
79+
user: 'admin',
80+
password: 'admin',
81+
authMechanism: 'SCRAM-SHA-1'
82+
});
8483

8584
client1.connect(function (err) {
8685
test.ok(err);
@@ -107,10 +106,7 @@ describe('Authentication', function () {
107106

108107
// restart server
109108
configuration.manager.restart(true).then(function () {
110-
var client = new MongoClient(
111-
new Server(configuration.host, configuration.port, { auto_reconnect: true }),
112-
{ w: 1 }
113-
);
109+
var client = new MongoClient(new Server(configuration.host, configuration.port), { w: 1 });
114110
client.connect(function (err, client) {
115111
test.equal(null, err);
116112
var db = client.db(configuration.db);
@@ -143,7 +139,7 @@ describe('Authentication', function () {
143139
test: function (done) {
144140
var configuration = this.configuration;
145141

146-
const client = configuration.newClient(configuration.writeConcernMax(), { poolSize: 1 });
142+
const client = configuration.newClient(configuration.writeConcernMax(), { maxPoolSize: 1 });
147143
client.connect(function (err, client) {
148144
var db = client.db(configuration.db);
149145
var collection = db.collection(
@@ -189,7 +185,7 @@ describe('Authentication', function () {
189185

190186
test: function (done) {
191187
var configuration = this.configuration;
192-
var client = configuration.newClient({ w: 1 }, { poolSize: 1 });
188+
var client = configuration.newClient({ w: 1 }, { maxPoolSize: 1 });
193189

194190
// DOC_LINE var client = new MongoClient(new Server('localhost', 27017));
195191
// DOC_START
@@ -245,7 +241,7 @@ describe('Authentication', function () {
245241

246242
// restart server
247243
configuration.manager.restart(true).then(function () {
248-
var client = new MongoClient(new Server('127.0.0.1', 27017, { auto_reconnect: true }), {
244+
var client = new MongoClient(new Server('127.0.0.1', 27017), {
249245
w: 1
250246
});
251247
client.connect(function (err, client) {
@@ -257,7 +253,7 @@ describe('Authentication', function () {
257253
test.equal(null, err);
258254
client.close();
259255

260-
new MongoClient(new Server('127.0.0.1', 27017, { auto_reconnect: true }), {
256+
new MongoClient(new Server('127.0.0.1', 27017), {
261257
w: 1,
262258
user: 'admin',
263259
password: 'admin',
@@ -278,7 +274,7 @@ describe('Authentication', function () {
278274
test.ok(err != null);
279275

280276
// // Login the user
281-
new MongoClient(new Server('127.0.0.1', 27017, { auto_reconnect: true }), {
277+
new MongoClient(new Server('127.0.0.1', 27017), {
282278
w: 1,
283279
user: 'user',
284280
password: 'user',
@@ -328,7 +324,7 @@ describe('Authentication', function () {
328324

329325
// restart server
330326
configuration.manager.restart(true).then(function () {
331-
var client = new MongoClient(new Server('localhost', 27017, { auto_reconnect: true }), {
327+
var client = new MongoClient(new Server('localhost', 27017), {
332328
w: 1
333329
});
334330
client.connect(function (err, client) {
@@ -344,7 +340,7 @@ describe('Authentication', function () {
344340
client.close();
345341

346342
// Login the user
347-
new MongoClient(new Server('127.0.0.1', 27017, { auto_reconnect: true }), {
343+
new MongoClient(new Server('127.0.0.1', 27017), {
348344
w: 1,
349345
user: 'admin',
350346
password: 'admin',
@@ -403,7 +399,7 @@ describe('Authentication', function () {
403399

404400
// restart server
405401
configuration.manager.restart(true).then(function () {
406-
var client = new MongoClient(new Server('127.0.0.1', 27017, { auto_reconnect: true }), {
402+
var client = new MongoClient(new Server('127.0.0.1', 27017), {
407403
w: 1
408404
});
409405

@@ -456,7 +452,7 @@ describe('Authentication', function () {
456452

457453
// restart server
458454
configuration.manager.restart(true).then(function () {
459-
var client = new MongoClient(new Server('127.0.0.1', 27017, { auto_reconnect: true }), {
455+
var client = new MongoClient(new Server('127.0.0.1', 27017), {
460456
w: 1
461457
});
462458
client.connect(function (err, client) {
@@ -600,7 +596,7 @@ describe('Authentication', function () {
600596
[new Server('localhost', 31000), new Server('localhost', 31001)],
601597
{
602598
rs_name: 'rs',
603-
poolSize: 1
599+
maxPoolSize: 1
604600
}
605601
);
606602

@@ -618,7 +614,7 @@ describe('Authentication', function () {
618614
new MongoClient(
619615
new ReplSet([new Server('localhost', 31000), new Server('localhost', 31001)], {
620616
rs_name: 'rs',
621-
poolSize: 1
617+
maxPoolSize: 1
622618
}),
623619
{ user: 'root', password: 'root', authSource: 'admin' }
624620
).connect(function (err, client) {
@@ -674,7 +670,7 @@ describe('Authentication', function () {
674670
[new Server('localhost', 31000), new Server('localhost', 31001)],
675671
{
676672
rs_name: 'rs',
677-
poolSize: 1
673+
maxPoolSize: 1
678674
}
679675
);
680676

@@ -747,7 +743,7 @@ describe('Authentication', function () {
747743
[new Server('localhost', 31000), new Server('localhost', 31001)],
748744
{
749745
rs_name: 'rs',
750-
poolSize: 1
746+
maxPoolSize: 1
751747
}
752748
);
753749

@@ -819,7 +815,7 @@ describe('Authentication', function () {
819815
[new Server('localhost', 31000), new Server('localhost', 31001)],
820816
{
821817
rs_name: 'rs',
822-
poolSize: 1
818+
maxPoolSize: 1
823819
}
824820
);
825821

@@ -837,7 +833,7 @@ describe('Authentication', function () {
837833
new MongoClient(
838834
new ReplSet([new Server('localhost', 31000), new Server('localhost', 31001)], {
839835
rs_name: 'rs',
840-
poolSize: 1
836+
maxPoolSize: 1
841837
}),
842838
{ w: 1, user: 'admin', password: 'admin', authSource: 'admin' }
843839
).connect(function (err, client) {
@@ -895,7 +891,7 @@ describe('Authentication', function () {
895891
[new Server('localhost', 31000), new Server('localhost', 31001)],
896892
{
897893
rs_name: 'rs',
898-
poolSize: 1
894+
maxPoolSize: 1
899895
}
900896
);
901897

@@ -912,7 +908,7 @@ describe('Authentication', function () {
912908
new MongoClient(
913909
new ReplSet([new Server('localhost', 31000), new Server('localhost', 31001)], {
914910
rs_name: 'rs',
915-
poolSize: 1
911+
maxPoolSize: 1
916912
}),
917913
{ w: 1, user: 'admin', password: 'admin', authSource: 'admin' }
918914
).connect(function (err, client) {
@@ -969,7 +965,7 @@ describe('Authentication', function () {
969965
[new Server('localhost', 31000), new Server('localhost', 31001)],
970966
{
971967
rs_name: 'rs',
972-
poolSize: 1
968+
maxPoolSize: 1
973969
}
974970
);
975971

@@ -986,7 +982,7 @@ describe('Authentication', function () {
986982
new MongoClient(
987983
new ReplSet([new Server('localhost', 31000), new Server('localhost', 31001)], {
988984
rs_name: 'rs',
989-
poolSize: 1
985+
maxPoolSize: 1
990986
}),
991987
{ w: 1, user: 'admin', password: 'admin', authSource: 'admin' }
992988
).connect(function (err, client) {
@@ -1107,7 +1103,7 @@ describe('Authentication', function () {
11071103
[new Server('localhost', 31000), new Server('localhost', 31001)],
11081104
{
11091105
rs_name: 'rs',
1110-
poolSize: 1
1106+
maxPoolSize: 1
11111107
}
11121108
);
11131109

@@ -1123,7 +1119,7 @@ describe('Authentication', function () {
11231119
new MongoClient(
11241120
new ReplSet([new Server('localhost', 31000), new Server('localhost', 31001)], {
11251121
rs_name: 'rs',
1126-
poolSize: 1
1122+
maxPoolSize: 1
11271123
}),
11281124
{ w: 1, user: 'me', password: 'secret', authSource: 'admin' }
11291125
).connect(function (err, client) {
@@ -1137,7 +1133,7 @@ describe('Authentication', function () {
11371133
new MongoClient(
11381134
new ReplSet([new Server('localhost', 31000), new Server('localhost', 31001)], {
11391135
rs_name: 'rs',
1140-
poolSize: 1
1136+
maxPoolSize: 1
11411137
}),
11421138
{ w: 1, user: 'test', password: 'test', authSource: configuration.db }
11431139
).connect(function (err, client) {
@@ -1193,7 +1189,7 @@ describe('Authentication', function () {
11931189
[new Server('localhost', 31000), new Server('localhost', 31001)],
11941190
{
11951191
rs_name: 'rs',
1196-
poolSize: 1
1192+
maxPoolSize: 1
11971193
}
11981194
);
11991195

@@ -1209,7 +1205,7 @@ describe('Authentication', function () {
12091205
new MongoClient(
12101206
new ReplSet([new Server('localhost', 31000), new Server('localhost', 31001)], {
12111207
rs_name: 'rs',
1212-
poolSize: 1
1208+
maxPoolSize: 1
12131209
}),
12141210
{ w: 1, user: 'me', password: 'secret', authSource: 'admin' }
12151211
).connect(function (err, client) {
@@ -1223,7 +1219,7 @@ describe('Authentication', function () {
12231219
new MongoClient(
12241220
new ReplSet([new Server('localhost', 31000), new Server('localhost', 31001)], {
12251221
rs_name: 'rs',
1226-
poolSize: 1
1222+
maxPoolSize: 1
12271223
}),
12281224
{ w: 1, user: 'test', password: 'test', authSource: configuration.db }
12291225
).connect(function (err, client) {
@@ -1267,7 +1263,7 @@ describe('Authentication', function () {
12671263
[new Server('localhost', 31000), new Server('localhost', 31001)],
12681264
{
12691265
rs_name: 'rs',
1270-
poolSize: 1
1266+
maxPoolSize: 1
12711267
}
12721268
);
12731269

@@ -1285,7 +1281,7 @@ describe('Authentication', function () {
12851281
new MongoClient(
12861282
new ReplSet([new Server('localhost', 31000), new Server('localhost', 31001)], {
12871283
rs_name: 'rs',
1288-
poolSize: 1
1284+
maxPoolSize: 1
12891285
}),
12901286
{ w: 1, user: 'me', password: 'secret', authSource: 'admin' }
12911287
).connect(function (err, client) {
@@ -1377,7 +1373,7 @@ describe('Authentication', function () {
13771373
[new Server('localhost', 31000), new Server('localhost', 31001)],
13781374
{
13791375
rs_name: 'rs',
1380-
poolSize: 1
1376+
maxPoolSize: 1
13811377
}
13821378
);
13831379

@@ -1394,7 +1390,7 @@ describe('Authentication', function () {
13941390
new MongoClient(
13951391
new ReplSet([new Server('localhost', 31000), new Server('localhost', 31001)], {
13961392
rs_name: 'rs',
1397-
poolSize: 1
1393+
maxPoolSize: 1
13981394
}),
13991395
{ w: 1, user: 'admin', password: 'admin', authSource: 'admin' }
14001396
).connect(function (err, client) {
@@ -1411,7 +1407,7 @@ describe('Authentication', function () {
14111407
new MongoClient(
14121408
new ReplSet([new Server('localhost', 31000), new Server('localhost', 31001)], {
14131409
rs_name: 'rs',
1414-
poolSize: 1
1410+
maxPoolSize: 1
14151411
}),
14161412
{ w: 1, user: 'test', password: 'test', authSource: configuration.db }
14171413
).connect(function (err, client) {
@@ -1474,7 +1470,7 @@ describe('Authentication', function () {
14741470
[new Server('localhost', 31000), new Server('localhost', 31001)],
14751471
{
14761472
rs_name: 'rs',
1477-
poolSize: 1
1473+
maxPoolSize: 1
14781474
}
14791475
);
14801476

@@ -1546,7 +1542,7 @@ describe('Authentication', function () {
15461542
[new Server('localhost', 31000), new Server('localhost', 31001)],
15471543
{
15481544
rs_name: 'rs',
1549-
poolSize: 1
1545+
maxPoolSize: 1
15501546
}
15511547
);
15521548

@@ -1561,7 +1557,7 @@ describe('Authentication', function () {
15611557
new MongoClient(
15621558
new ReplSet([new Server('localhost', 31000), new Server('localhost', 31001)], {
15631559
rs_name: 'rs',
1564-
poolSize: 1
1560+
maxPoolSize: 1
15651561
}),
15661562
{ w: 1, user: 'admin', password: 'admin', authSource: 'admin' }
15671563
).connect(function (err, client) {
@@ -1677,7 +1673,7 @@ describe('Authentication', function () {
16771673
Mongos = configuration.require.Mongos;
16781674

16791675
setUpSharded(configuration, function (err, manager) {
1680-
var mongos = new Mongos([new Server('localhost', 51000)], { poolSize: 1 });
1676+
var mongos = new Mongos([new Server('localhost', 51000)], { maxPoolSize: 1 });
16811677

16821678
var client = new MongoClient(mongos, { w: 1 });
16831679
client.connect(function (err, client) {
@@ -1689,7 +1685,7 @@ describe('Authentication', function () {
16891685
test.equal(null, err);
16901686
client.close();
16911687

1692-
new MongoClient(new Mongos([new Server('localhost', 51000)], { poolSize: 1 }), {
1688+
new MongoClient(new Mongos([new Server('localhost', 51000)], { maxPoolSize: 1 }), {
16931689
w: 1,
16941690
user: 'admin',
16951691
password: 'admin',
@@ -1741,7 +1737,7 @@ describe('Authentication', function () {
17411737
Mongos = configuration.require.Mongos;
17421738

17431739
setUpSharded(configuration, function (err, manager) {
1744-
var mongos = new Mongos([new Server('localhost', 51000)], { poolSize: 1 });
1740+
var mongos = new Mongos([new Server('localhost', 51000)], { maxPoolSize: 1 });
17451741

17461742
var client = new MongoClient(mongos, { w: 1 });
17471743
client.connect(function (err, client) {
@@ -1753,7 +1749,7 @@ describe('Authentication', function () {
17531749
test.equal(null, err);
17541750
client.close();
17551751

1756-
new MongoClient(new Mongos([new Server('localhost', 51000)], { poolSize: 1 }), {
1752+
new MongoClient(new Mongos([new Server('localhost', 51000)], { maxPoolSize: 1 }), {
17571753
w: 1,
17581754
user: 'admin',
17591755
password: 'admin',

0 commit comments

Comments
 (0)