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

Function testOperations

test/tools/spec-runner/index.js:968–985  ·  view source on GitHub ↗
(testData, operationContext, options)

Source from the content-addressed store, hash-verified

966}
967
968async function testOperations(testData, operationContext, options) {
969 options = options || { swallowOperationErrors: true };
970
971 for (const operation of testData.operations) {
972 const object = operation.object || 'collection';
973 if (object === 'collection') {
974 const db = operationContext.database;
975 const collectionName = operationContext.collectionName;
976 const collectionOptions = operation.collectionOptions || {};
977
978 operationContext[object] = db.collection(
979 collectionName,
980 convertCollectionOptions(collectionOptions)
981 );
982 }
983 await testOperation(operation, operationContext[object], operationContext, options);
984 }
985}
986
987module.exports = {
988 TestRunnerContext,

Callers 3

runTestSuiteTestFunction · 0.85
resolveOperationArgsFunction · 0.85
testOperationFunction · 0.85

Calls 3

convertCollectionOptionsFunction · 0.85
testOperationFunction · 0.85
collectionMethod · 0.65

Tested by

no test coverage detected