Skip to content

Commit 252dab8

Browse files
authored
test(NODE-7219): remove unused tests (#4767)
1 parent 76c98bb commit 252dab8

File tree

15 files changed

+6
-1471
lines changed

15 files changed

+6
-1471
lines changed

test/integration/causal-consistency/causal_consistency.prose.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ describe('Causal Consistency - prose tests', function () {
169169
let firstOperationTime;
170170
return db
171171
.collection('causal_test')
172-
.insert({}, { session: session })
172+
.insertOne({}, { session: session })
173173
.then(() => {
174174
firstOperationTime = test.commands.succeeded[0].reply.operationTime;
175175
return db.collection('causal_test').findOne({}, { session: session });

test/integration/crud/bulk.test.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,22 +1376,6 @@ describe('Bulk', function () {
13761376
expect(error).to.have.property('message', 'Invalid BulkOperation, Batch cannot be empty');
13771377
});
13781378

1379-
// TODO(NODE-7219): remove outdated test
1380-
// it('should return an error instead of throwing when an empty bulk operation is submitted (with promise)', function () {
1381-
// return client
1382-
// .db()
1383-
// .collection('doesnt_matter')
1384-
// .insertMany([])
1385-
//
1386-
// .then(function () {
1387-
// test.equal(false, true); // this should not happen!
1388-
// })
1389-
// .catch(function (err) {
1390-
// expect(err).to.be.instanceOf(MongoDriverError);
1391-
// expect(err).to.have.property('message', 'Invalid BulkOperation, Batch cannot be empty');
1392-
// });
1393-
// });
1394-
13951379
it('should properly account for array key size in bulk unordered inserts', async function () {
13961380
const documents = new Array(20000).fill('').map(() => ({
13971381
arr: new Array(19).fill('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')

test/integration/crud/crud_api.test.ts

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -315,35 +315,6 @@ describe('CRUD API', function () {
315315
await db.collection('t1').drop();
316316
});
317317

318-
// TODO(NODE-7219): Remove test as it doesn't test correct aggregation execution
319-
// it('allMethods', async function () {
320-
// const cursor = db.collection('t1').aggregate([{ $match: {} }], {
321-
// allowDiskUse: true,
322-
// batchSize: 2,
323-
// maxTimeMS: 50
324-
// });
325-
//
326-
// // Exercise all the options
327-
// cursor
328-
// .geoNear({ geo: 1 })
329-
// .group({ group: 1 })
330-
// .limit(10)
331-
// .match({ match: 1 })
332-
// .maxTimeMS(10)
333-
// .out('collection')
334-
// .project({ project: 1 })
335-
// .redact({ redact: 1 })
336-
// .skip(1)
337-
// .sort({ sort: 1 })
338-
// .batchSize(10)
339-
// .unwind('name');
340-
//
341-
// // Execute the command with all steps defined
342-
// // will fail
343-
// const err = await cursor.toArray().catch(err => err);
344-
// expect(err).to.be.instanceof(MongoServerError);
345-
// });
346-
347318
it('#toArray()', async function () {
348319
const cursor = db.collection('t1').aggregate();
349320
cursor.match({ a: 1 });
@@ -477,15 +448,6 @@ describe('CRUD API', function () {
477448
});
478449

479450
describe('should correctly execute update methods using crud api', function () {
480-
// TODO(NODE-7219): Remove test. There is no `update` method anymore
481-
// it('legacy update', async function () {
482-
// const db = client.db();
483-
// const r = await db
484-
// .collection('t3_1')
485-
// .update({ a: 1 }, { $set: { a: 2 } }, { upsert: true });
486-
// expect(r).property('upsertedCount').to.equal(1);
487-
// });
488-
489451
it('#updateOne()', async function () {
490452
const db = client.db();
491453
const i = await db.collection('t3_2').insertMany([{ c: 1 }], { writeConcern: { w: 1 } });
@@ -805,25 +767,6 @@ describe('CRUD API', function () {
805767
test.ok(r != null);
806768
});
807769

808-
// TODO(NODE-7219): Remove test as it duplicates the one from the above
809-
// it('should correctly execute crud operations using w:0', {
810-
// metadata: {
811-
// requires: { topology: ['single', 'replicaset', 'sharded'] }
812-
// },
813-
//
814-
// test: async function () {
815-
// const db = client.db();
816-
//
817-
// const collection = db.collection<{ _id: number }>('w0crudoperations');
818-
// const r = await collection.updateOne(
819-
// { _id: 1 },
820-
// { $set: { x: 1 } },
821-
// { upsert: true, writeConcern: { w: 0 } }
822-
// );
823-
// test.ok(r != null);
824-
// }
825-
// });
826-
827770
describe('when performing a multi-batch unordered bulk write that has a duplicate key', function () {
828771
it('throws a MongoBulkWriteError indicating the duplicate key document failed', async function () {
829772
const ops = [];

0 commit comments

Comments
 (0)