(testData, testContext)
| 419 | } |
| 420 | |
| 421 | function 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 | |
| 440 | function validateExpectations(commandEvents, spec, savedSessionData) { |
| 441 | if (!spec.expectations || !Array.isArray(spec.expectations) || spec.expectations.length === 0) { |
no test coverage detected