MCPcopy
hub / github.com/mongodb/node-mongodb-native / throwErrorTest

Function throwErrorTest

test/integration/index_management.test.ts:731–743  ·  view source on GitHub ↗
(testCommand: (db: Db, collection: Collection) => Promise<any>)

Source from the content-addressed store, hash-verified

729 });
730
731 function throwErrorTest(testCommand: (db: Db, collection: Collection) => Promise<any>) {
732 return {
733 metadata: { requires: { mongodb: '<4.4' } },
734 test: async function () {
735 const db = client.db('test');
736 const collection = db.collection('commitQuorum');
737 const err = await testCommand(db, collection).catch(e => e);
738 expect(err.message).to.equal(
739 'Option `commitQuorum` for `createIndexes` not supported on servers < 4.4'
740 );
741 }
742 };
743 }
744 it(
745 'should throw an error if commitQuorum specified on db.createIndex',
746 throwErrorTest((db, collection) =>

Callers 1

Calls 2

collectionMethod · 0.65
dbMethod · 0.45

Tested by

no test coverage detected