Skip to content

Commit 5816fa2

Browse files
committed
linter fixes
1 parent 127158f commit 5816fa2

File tree

2 files changed

+67
-67
lines changed

2 files changed

+67
-67
lines changed

src/operations/map_reduce.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
Callback,
99
maxWireVersion
1010
} from '../utils';
11-
import { ReadPreference, ReadPreferenceMode } from '../read_preference';
11+
import { ReadPreference } from '../read_preference';
1212
import { CommandOperation, CommandOperationOptions } from './command';
1313
import type { Server } from '../sdam/server';
1414
import type { Collection } from '../collection';

test/unit/core/connection_string.test.js

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -220,72 +220,72 @@ describe('Connection String', function () {
220220
suites.forEach(suite => {
221221
describe(suite.name, function () {
222222
suite.tests.forEach(test => {
223-
// it(test.description, {
224-
// metadata: { requires: { topology: 'single' } },
225-
// test: function (done) {
226-
// if (skipTests.indexOf(test.description) !== -1) {
227-
// return this.skip();
228-
// }
229-
230-
// const valid = test.valid;
231-
// parseConnectionString(test.uri, { caseTranslate: false }, function (err, result) {
232-
// if (valid === false) {
233-
// expect(err).to.exist;
234-
// expect(err).to.be.instanceOf(MongoParseError);
235-
// expect(result).to.not.exist;
236-
// } else {
237-
// expect(err).to.not.exist;
238-
// expect(result).to.exist;
239-
240-
// // remove data we don't track
241-
// if (test.auth && test.auth.password === '') {
242-
// test.auth.password = null;
243-
// }
244-
245-
// if (test.hosts != null) {
246-
// test.hosts = test.hosts.map(host => {
247-
// delete host.type;
248-
// host.host = punycode.toASCII(host.host);
249-
// return host;
250-
// });
251-
252-
// // remove values that require no validation
253-
// test.hosts.forEach(host => {
254-
// Object.keys(host).forEach(key => {
255-
// if (host[key] == null) delete host[key];
256-
// });
257-
// });
258-
259-
// expect(result.hosts).to.containSubset(test.hosts);
260-
// }
261-
262-
// if (test.auth) {
263-
// if (test.auth.db != null) {
264-
// expect(result.auth).to.have.property('db');
265-
// expect(result.auth.db).to.eql(test.auth.db);
266-
// }
267-
268-
// if (test.auth.username != null) {
269-
// expect(result.auth).to.have.property('username');
270-
// expect(result.auth.username).to.eql(test.auth.username);
271-
// }
272-
273-
// if (test.auth.password != null) {
274-
// expect(result.auth).to.have.property('password');
275-
// expect(result.auth.password).to.eql(test.auth.password);
276-
// }
277-
// }
278-
279-
// if (test.options != null) {
280-
// // it's possible we have options which are not explicitly included in the spec test
281-
// expect(result.options).to.deep.include(test.options);
282-
// }
283-
// }
284-
285-
// done();
286-
// });
287-
// }
288-
// });
223+
it(test.description, {
224+
metadata: { requires: { topology: 'single' } },
225+
test: function (done) {
226+
if (skipTests.indexOf(test.description) !== -1) {
227+
return this.skip();
228+
}
229+
230+
const valid = test.valid;
231+
parseConnectionString(test.uri, { caseTranslate: false }, function (err, result) {
232+
if (valid === false) {
233+
expect(err).to.exist;
234+
expect(err).to.be.instanceOf(MongoParseError);
235+
expect(result).to.not.exist;
236+
} else {
237+
expect(err).to.not.exist;
238+
expect(result).to.exist;
239+
240+
// remove data we don't track
241+
if (test.auth && test.auth.password === '') {
242+
test.auth.password = null;
243+
}
244+
245+
if (test.hosts != null) {
246+
test.hosts = test.hosts.map(host => {
247+
delete host.type;
248+
host.host = punycode.toASCII(host.host);
249+
return host;
250+
});
251+
252+
// remove values that require no validation
253+
test.hosts.forEach(host => {
254+
Object.keys(host).forEach(key => {
255+
if (host[key] == null) delete host[key];
256+
});
257+
});
258+
259+
expect(result.hosts).to.containSubset(test.hosts);
260+
}
261+
262+
if (test.auth) {
263+
if (test.auth.db != null) {
264+
expect(result.auth).to.have.property('db');
265+
expect(result.auth.db).to.eql(test.auth.db);
266+
}
267+
268+
if (test.auth.username != null) {
269+
expect(result.auth).to.have.property('username');
270+
expect(result.auth.username).to.eql(test.auth.username);
271+
}
272+
273+
if (test.auth.password != null) {
274+
expect(result.auth).to.have.property('password');
275+
expect(result.auth.password).to.eql(test.auth.password);
276+
}
277+
}
278+
279+
if (test.options != null) {
280+
// it's possible we have options which are not explicitly included in the spec test
281+
expect(result.options).to.deep.include(test.options);
282+
}
283+
}
284+
285+
done();
286+
});
287+
}
288+
});
289289

290290
it(`${test.description} -- new MongoOptions parser`, function () {
291291
if (skipTests.includes(test.description)) {

0 commit comments

Comments
 (0)