Skip to content

Commit

Permalink
linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken committed Nov 23, 2020
1 parent 127158f commit 5816fa2
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 67 deletions.
2 changes: 1 addition & 1 deletion src/operations/map_reduce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
Callback,
maxWireVersion
} from '../utils';
import { ReadPreference, ReadPreferenceMode } from '../read_preference';
import { ReadPreference } from '../read_preference';
import { CommandOperation, CommandOperationOptions } from './command';
import type { Server } from '../sdam/server';
import type { Collection } from '../collection';
Expand Down
132 changes: 66 additions & 66 deletions test/unit/core/connection_string.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,72 +220,72 @@ describe('Connection String', function () {
suites.forEach(suite => {
describe(suite.name, function () {
suite.tests.forEach(test => {
// it(test.description, {
// metadata: { requires: { topology: 'single' } },
// test: function (done) {
// if (skipTests.indexOf(test.description) !== -1) {
// return this.skip();
// }

// const valid = test.valid;
// parseConnectionString(test.uri, { caseTranslate: false }, function (err, result) {
// if (valid === false) {
// expect(err).to.exist;
// expect(err).to.be.instanceOf(MongoParseError);
// expect(result).to.not.exist;
// } else {
// expect(err).to.not.exist;
// expect(result).to.exist;

// // remove data we don't track
// if (test.auth && test.auth.password === '') {
// test.auth.password = null;
// }

// if (test.hosts != null) {
// test.hosts = test.hosts.map(host => {
// delete host.type;
// host.host = punycode.toASCII(host.host);
// return host;
// });

// // remove values that require no validation
// test.hosts.forEach(host => {
// Object.keys(host).forEach(key => {
// if (host[key] == null) delete host[key];
// });
// });

// expect(result.hosts).to.containSubset(test.hosts);
// }

// if (test.auth) {
// if (test.auth.db != null) {
// expect(result.auth).to.have.property('db');
// expect(result.auth.db).to.eql(test.auth.db);
// }

// if (test.auth.username != null) {
// expect(result.auth).to.have.property('username');
// expect(result.auth.username).to.eql(test.auth.username);
// }

// if (test.auth.password != null) {
// expect(result.auth).to.have.property('password');
// expect(result.auth.password).to.eql(test.auth.password);
// }
// }

// if (test.options != null) {
// // it's possible we have options which are not explicitly included in the spec test
// expect(result.options).to.deep.include(test.options);
// }
// }

// done();
// });
// }
// });
it(test.description, {
metadata: { requires: { topology: 'single' } },
test: function (done) {
if (skipTests.indexOf(test.description) !== -1) {
return this.skip();
}

const valid = test.valid;
parseConnectionString(test.uri, { caseTranslate: false }, function (err, result) {
if (valid === false) {
expect(err).to.exist;
expect(err).to.be.instanceOf(MongoParseError);
expect(result).to.not.exist;
} else {
expect(err).to.not.exist;
expect(result).to.exist;

// remove data we don't track
if (test.auth && test.auth.password === '') {
test.auth.password = null;
}

if (test.hosts != null) {
test.hosts = test.hosts.map(host => {
delete host.type;
host.host = punycode.toASCII(host.host);
return host;
});

// remove values that require no validation
test.hosts.forEach(host => {
Object.keys(host).forEach(key => {
if (host[key] == null) delete host[key];
});
});

expect(result.hosts).to.containSubset(test.hosts);
}

if (test.auth) {
if (test.auth.db != null) {
expect(result.auth).to.have.property('db');
expect(result.auth.db).to.eql(test.auth.db);
}

if (test.auth.username != null) {
expect(result.auth).to.have.property('username');
expect(result.auth.username).to.eql(test.auth.username);
}

if (test.auth.password != null) {
expect(result.auth).to.have.property('password');
expect(result.auth.password).to.eql(test.auth.password);
}
}

if (test.options != null) {
// it's possible we have options which are not explicitly included in the spec test
expect(result.options).to.deep.include(test.options);
}
}

done();
});
}
});

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

0 comments on commit 5816fa2

Please sign in to comment.