(command, testFn)
| 95 | } |
| 96 | |
| 97 | function writeConcernTest(command, testFn) { |
| 98 | return async function () { |
| 99 | const t = new WriteConcernTest(); |
| 100 | switch (command) { |
| 101 | case 'aggregate': |
| 102 | t.decorateResponse({ cursor: { id: 0, firstBatch: [], ns: 'write_concern_db' } }); |
| 103 | break; |
| 104 | } |
| 105 | await t.run(command, async (client, db) => { |
| 106 | await testFn(db, Object.assign({}, TEST_OPTIONS)); |
| 107 | expect({ |
| 108 | w: TEST_OPTIONS.writeConcern.w, |
| 109 | wtimeout: TEST_OPTIONS.writeConcern.wtimeoutMS |
| 110 | }).to.deep.equal(t.commandResult.writeConcern); |
| 111 | await client.close(); |
| 112 | }); |
| 113 | }; |
| 114 | } |
| 115 | |
| 116 | describe('Command Write Concern', function () { |
| 117 | afterEach(() => mock.cleanup()); |
no test coverage detected