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

Function validateOutcome

test/tools/spec-runner/index.js:421–438  ·  view source on GitHub ↗
(testData, testContext)

Source from the content-addressed store, hash-verified

419}
420
421function validateOutcome(testData, testContext) {
422 if (testData.outcome && testData.outcome.collection) {
423 const outcomeCollection = testData.outcome.collection.name || testContext.collectionName;
424
425 // use the client without transactions to verify
426 return testContext.sharedClient
427 .db(testContext.dbName)
428 .collection(outcomeCollection)
429 .find({}, { readPreference: 'primary', readConcern: { level: 'local' } })
430 .sort({ _id: 1 })
431 .toArray()
432 .then(docs => {
433 expect(docs).to.matchMongoSpec(testData.outcome.collection.data);
434 });
435 }
436
437 return Promise.resolve();
438}
439
440function validateExpectations(commandEvents, spec, savedSessionData) {
441 if (!spec.expectations || !Array.isArray(spec.expectations) || spec.expectations.length === 0) {

Callers 1

generateTopologyTestsFunction · 0.85

Calls 5

toArrayMethod · 0.80
collectionMethod · 0.65
sortMethod · 0.45
findMethod · 0.45
dbMethod · 0.45

Tested by

no test coverage detected