Skip to content

Commit 5c96d20

Browse files
committed
clean up fixmes
1 parent e99d4b2 commit 5c96d20

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

test/functional/collations.test.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
'use strict';
22
const setupDatabase = require('./shared').setupDatabase;
33
const mock = require('mongodb-mock-server');
4-
const chai = require('chai');
5-
chai.use(require('chai-subset'));
6-
const expect = chai.expect;
4+
const expect = require('chai').expect;
75

86
const testContext = {};
97
describe('Collation', function() {
@@ -680,7 +678,8 @@ describe('Collation', function() {
680678
.collection('test')
681679
.createIndex({ a: 1 }, { collation: { caseLevel: true } })
682680
.then(() => {
683-
expect(commandResult).to.containSubset({
681+
delete commandResult.apiVersion;
682+
expect(commandResult).to.eql({
684683
createIndexes: 'test',
685684
indexes: [{ name: 'a_1', key: { a: 1 }, collation: { caseLevel: true } }]
686685
});

test/functional/crud_spec.test.js

-6
Original file line numberDiff line numberDiff line change
@@ -488,12 +488,6 @@ describe('CRUD unified', function() {
488488
it(String(test.description), {
489489
metadata: { sessions: { skipLeakTests: true } },
490490
test() {
491-
// FIXME(NODE-3191)
492-
if (
493-
test.description.match(/^estimatedDocumentCount errors correctly on 4.9.0 or greater/)
494-
) {
495-
return this.skip();
496-
}
497491
return runUnifiedTest(this, crudSpecTest, test);
498492
}
499493
});

test/functional/max_staleness.test.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
'use strict';
22
const Long = require('bson').Long;
3-
const chai = require('chai');
4-
const expect = chai.expect;
5-
chai.use(require('chai-subset'));
3+
const expect = require('chai').expect;
64
const mock = require('mongodb-mock-server');
75

86
const test = {};
@@ -66,7 +64,8 @@ describe('Max Staleness', function() {
6664
.find({})
6765
.toArray(function(err) {
6866
expect(err).to.not.exist;
69-
expect(test.checkCommand).to.containSubset({
67+
delete test.checkCommand.apiVersion;
68+
expect(test.checkCommand).to.eql({
7069
$query: { find: 'test', filter: {}, returnKey: false, showRecordId: false },
7170
$readPreference: { mode: 'secondary', maxStalenessSeconds: 250 }
7271
});
@@ -104,7 +103,8 @@ describe('Max Staleness', function() {
104103
.find({})
105104
.toArray(function(err) {
106105
expect(err).to.not.exist;
107-
expect(test.checkCommand).to.containSubset({
106+
delete test.checkCommand.apiVersion;
107+
expect(test.checkCommand).to.eql({
108108
$query: { find: 'test', filter: {}, returnKey: false, showRecordId: false },
109109
$readPreference: { mode: 'secondary', maxStalenessSeconds: 250 }
110110
});
@@ -142,7 +142,8 @@ describe('Max Staleness', function() {
142142
.find({})
143143
.toArray(function(err) {
144144
expect(err).to.not.exist;
145-
expect(test.checkCommand).to.containSubset({
145+
delete test.checkCommand.apiVersion;
146+
expect(test.checkCommand).to.eql({
146147
$query: { find: 'test', filter: {}, returnKey: false, showRecordId: false },
147148
$readPreference: { mode: 'secondary', maxStalenessSeconds: 250 }
148149
});
@@ -179,7 +180,8 @@ describe('Max Staleness', function() {
179180
.setReadPreference(readPreference)
180181
.toArray(function(err) {
181182
expect(err).to.not.exist;
182-
expect(test.checkCommand).to.containSubset({
183+
delete test.checkCommand.apiVersion;
184+
expect(test.checkCommand).to.eql({
183185
$query: { find: 'test', filter: {}, returnKey: false, showRecordId: false },
184186
$readPreference: { mode: 'secondary', maxStalenessSeconds: 250 }
185187
});

test/functional/unified-spec-runner/entities.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ function serverApiConfig() {
4545
}
4646

4747
function getClient(address) {
48+
const options: any = { useUnifiedTopology: Boolean(process.env.MONGODB_UNIFIED_TOPOLOGY) };
4849
const serverApi = serverApiConfig();
49-
return new MongoClient(`mongodb://${address}`, serverApi ? { serverApi } : {});
50+
if (serverApi) {
51+
options.serverApi = serverApi;
52+
}
53+
return new MongoClient(`mongodb://${address}`, options);
5054
}
5155

5256
export interface UnifiedMongoClient {

test/functional/versioned-api.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ describe('Versioned API', function() {
2424
metadata: { sessions: { skipLeakTests: true } },
2525
test() {
2626
// FIXME(NODE-3191)
27+
// MongoError: BSON field 'FindCommandRequest.returnKey' is not allowed with apiStrict:true.
2728
if (
2829
versionedApiTest.description.match(/strict/) &&
2930
test.description.match(/find and getMore append API version/)

test/functional/view.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ var expect = require('chai').expect,
44
co = require('co');
55

66
describe('Views', function() {
7-
// FIXME(NODE-3191)
87
it('should successfully pass through collation to findAndModify command', {
9-
metadata: { requires: { generators: true, topology: 'single', apiVersion: false } },
8+
metadata: { requires: { generators: true, topology: 'single' } },
109

1110
test: function(done) {
1211
var self = this;
@@ -59,6 +58,7 @@ describe('Views', function() {
5958
) {
6059
expect(r).to.exist;
6160
expect(err).to.not.exist;
61+
delete commandResult.apiVersion;
6262
expect(commandResult).to.eql({
6363
create: 'test',
6464
viewOn: 'users',

0 commit comments

Comments
 (0)