Skip to content

Commit 2ac63c0

Browse files
author
Jessica Lord
committed
test(url parser): update to include all test servers
1 parent 52b6039 commit 2ac63c0

File tree

1 file changed

+38
-11
lines changed

1 file changed

+38
-11
lines changed

test/functional/url_parser_tests.js

+38-11
Original file line numberDiff line numberDiff line change
@@ -1174,19 +1174,44 @@ describe('Url SRV Parser', function() {
11741174
}
11751175
});
11761176

1177+
/**
1178+
* test7.test server is n/a
1179+
*/
1180+
1181+
/**
1182+
* @ignore
1183+
*/
1184+
it('should error when a key with no value', {
1185+
metadata: {
1186+
requires: { topology: ['single'] }
1187+
},
1188+
test: function(done) {
1189+
// This text record key contains no value
1190+
// readPreference
1191+
parse('mongodb+srv://test8.test.build.10gen.cc', {}, function(err) {
1192+
expect(err).to.exist;
1193+
expect(err.message).to.equal('query parameter readPreference is an incomplete value pair');
1194+
done();
1195+
});
1196+
}
1197+
});
1198+
1199+
/**
1200+
* test9.test server is n/a
1201+
*/
1202+
11771203
/**
11781204
* @ignore
11791205
*/
1180-
it.skip('should handle text record with listable option override', {
1206+
it('should ignore element when a value is an unspported format', {
11811207
metadata: {
11821208
requires: { topology: ['single'] }
11831209
},
11841210
test: function(done) {
1185-
// TODO Test server has not been updated, when updated fill out this test
1186-
// mongodb+srv://test7.test.build.10gen.cc/?replicaSet=repl0&readPreferenceTags=dc:fr,item:cheese&readPreferenceTags=dc:de,item:hotdog
1187-
parse('mongodb+srv://test7.test.build.10gen.cc', {}, function(err, object) {
1188-
console.dir(object, { depth: 5 });
1211+
// This text record's key contains an unsupported format (expected interger, given string)
1212+
parse('mongodb+srv://test10.test.build.10gen.cc', {}, function(err, object) {
11891213
expect(err).to.be.null;
1214+
expect(object.server_options.socketOptions).to.deep.equal({});
11901215
done();
11911216
});
11921217
}
@@ -1195,16 +1220,18 @@ describe('Url SRV Parser', function() {
11951220
/**
11961221
* @ignore
11971222
*/
1198-
it('should error when a key with no value', {
1223+
it('should handle single text records with multiple strings', {
11991224
metadata: {
12001225
requires: { topology: ['single'] }
12011226
},
12021227
test: function(done) {
1203-
// This text record key contains no value
1204-
// readPreference
1205-
parse('mongodb+srv://test8.test.build.10gen.cc', {}, function(err) {
1206-
expect(err).to.exist;
1207-
expect(err.message).to.equal('query parameter readPreference is an incomplete value pair');
1228+
// This text record contains multiple strings
1229+
parse('mongodb+srv://test11.test.build.10gen.cc', function(err, object) {
1230+
var serverOptions = {
1231+
socketOptions: { connectTimeoutMS: 150000, socketTimeoutMS: 250000 }
1232+
};
1233+
expect(err).to.be.null;
1234+
expect(object.server_options).to.deep.equal(serverOptions);
12081235
done();
12091236
});
12101237
}

0 commit comments

Comments
 (0)