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

Function isTestRunnerCommand

test/tools/spec-runner/index.js:544–558  ·  test/tools/spec-runner/index.js::isTestRunnerCommand
(context, commandName)

Source from the content-addressed store, hash-verified

542}
543
544function isTestRunnerCommand(context, commandName) {
545 const testRunnerContext = context.testRunner;
546
547 let methods = new Set();
548 let object = testRunnerContext;
549 while (object !== Object.prototype) {
550 Object.getOwnPropertyNames(object)
551 .filter(prop => typeof object[prop] === class="st">'function' && prop !== class="st">'constructor')
552 .map(prop => methods.add(prop));
553
554 object = Object.getPrototypeOf(object);
555 }
556
557 return methods.has(commandName);
558}
559
560function extractBulkRequests(requests) {
561 return requests.map(request => ({ [request.name]: request.arguments }));

Callers 1

testOperationFunction · 0.85

Calls 4

addMethod · 0.80
mapMethod · 0.45
filterMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected