Skip to content

Commit 922c3ab

Browse files
committed
test: use a different conflicting option for index error validation
The particular combination of options used in this test are actually supported in MongoDB 4.6, so we need to change the test.
1 parent 6eb6d6c commit 922c3ab

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

test/functional/index.test.js

+12-16
Original file line numberDiff line numberDiff line change
@@ -1272,24 +1272,20 @@ describe('Indexes', function() {
12721272
var db = client.db(configuration.db);
12731273
var collection = db.collection('messed_up_options');
12741274

1275-
collection.ensureIndex(
1276-
{ 'a.one': 1, 'a.two': 1 },
1277-
{ name: 'n1', partialFilterExpression: { 'a.two': { $exists: true } } },
1278-
function(err) {
1279-
test.equal(null, err);
1275+
collection.ensureIndex({ 'a.one': 1, 'a.two': 1 }, { name: 'n1', sparse: false }, function(
1276+
err
1277+
) {
1278+
test.equal(null, err);
12801279

1281-
collection.ensureIndex(
1282-
{ 'a.one': 1, 'a.two': 1 },
1283-
{ name: 'n2', partialFilterExpression: { 'a.too': { $exists: true } } },
1284-
function(err) {
1285-
test.ok(err);
1286-
test.equal(85, err.code);
1280+
collection.ensureIndex({ 'a.one': 1, 'a.two': 1 }, { name: 'n2', sparse: true }, function(
1281+
err
1282+
) {
1283+
test.ok(err);
1284+
test.equal(85, err.code);
12871285

1288-
client.close(done);
1289-
}
1290-
);
1291-
}
1292-
);
1286+
client.close(done);
1287+
});
1288+
});
12931289
});
12941290
}
12951291
});

0 commit comments

Comments
 (0)