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

Function writeConcernTest

test/unit/assorted/write_concern.test.js:97–114  ·  view source on GitHub ↗
(command, testFn)

Source from the content-addressed store, hash-verified

95}
96
97function 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
116describe('Command Write Concern', function () {
117 afterEach(() => mock.cleanup());

Callers 1

Calls 3

decorateResponseMethod · 0.95
runMethod · 0.95
closeMethod · 0.45

Tested by

no test coverage detected