|
1 | 1 | 'use strict';
|
2 | 2 | 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; |
6 | 4 | const mock = require('mongodb-mock-server');
|
7 | 5 |
|
8 | 6 | const test = {};
|
@@ -66,7 +64,8 @@ describe('Max Staleness', function() {
|
66 | 64 | .find({})
|
67 | 65 | .toArray(function(err) {
|
68 | 66 | expect(err).to.not.exist;
|
69 |
| - expect(test.checkCommand).to.containSubset({ |
| 67 | + delete test.checkCommand.apiVersion; |
| 68 | + expect(test.checkCommand).to.eql({ |
70 | 69 | $query: { find: 'test', filter: {}, returnKey: false, showRecordId: false },
|
71 | 70 | $readPreference: { mode: 'secondary', maxStalenessSeconds: 250 }
|
72 | 71 | });
|
@@ -104,7 +103,8 @@ describe('Max Staleness', function() {
|
104 | 103 | .find({})
|
105 | 104 | .toArray(function(err) {
|
106 | 105 | expect(err).to.not.exist;
|
107 |
| - expect(test.checkCommand).to.containSubset({ |
| 106 | + delete test.checkCommand.apiVersion; |
| 107 | + expect(test.checkCommand).to.eql({ |
108 | 108 | $query: { find: 'test', filter: {}, returnKey: false, showRecordId: false },
|
109 | 109 | $readPreference: { mode: 'secondary', maxStalenessSeconds: 250 }
|
110 | 110 | });
|
@@ -142,7 +142,8 @@ describe('Max Staleness', function() {
|
142 | 142 | .find({})
|
143 | 143 | .toArray(function(err) {
|
144 | 144 | expect(err).to.not.exist;
|
145 |
| - expect(test.checkCommand).to.containSubset({ |
| 145 | + delete test.checkCommand.apiVersion; |
| 146 | + expect(test.checkCommand).to.eql({ |
146 | 147 | $query: { find: 'test', filter: {}, returnKey: false, showRecordId: false },
|
147 | 148 | $readPreference: { mode: 'secondary', maxStalenessSeconds: 250 }
|
148 | 149 | });
|
@@ -179,7 +180,8 @@ describe('Max Staleness', function() {
|
179 | 180 | .setReadPreference(readPreference)
|
180 | 181 | .toArray(function(err) {
|
181 | 182 | expect(err).to.not.exist;
|
182 |
| - expect(test.checkCommand).to.containSubset({ |
| 183 | + delete test.checkCommand.apiVersion; |
| 184 | + expect(test.checkCommand).to.eql({ |
183 | 185 | $query: { find: 'test', filter: {}, returnKey: false, showRecordId: false },
|
184 | 186 | $readPreference: { mode: 'secondary', maxStalenessSeconds: 250 }
|
185 | 187 | });
|
|
0 commit comments