(testCommand: (db: Db, collection: Collection) => Promise<any>)
| 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) => |
no test coverage detected