jstests/libs/all_commands_test.js
/**
     * The runner function for this library.
     * Use the 'skip' option for tests that should not run.
     *
     * @param {Object} conn The shell connection to run the suite over.
     * @param {map} cmdMap A map of all commands, with their invocations and expected behavior.
     * @param {function} testFn A user-defined function to execute on every command.
     */
The runner function for this library.
Use the 'skip' option for tests that should not run.

@param {Object} conn The shell connection to run the suite over.
@param {map} cmdMap A map of all commands, with their invocations and expected behavior.
@param {function} testFn A user-defined function to execute on every command.
The runner function for this library . Use the ' skip ' option for tests that should not run . @param { Object } conn The shell connection to run the suite over . @param { map } cmdMap A map of all commands with their invocations and expected behavior . @param { function } testFn A user - defined function to execute on every command .
function testAllCommands(conn, cmdMap, testFn) {
        const commands = checkCommandCoverage(conn, cmdMap);
        for (const command of commands) {
            const test = cmdMap[command];
            assert(test, "Coverage failure: must explicitly define a test for " + command);
            if (test.skip !== undefined) {
                jsTestLog("Skipping " + command + ": " + test.skip);
                continue;
            }
            jsTestName("Testing " + command);
            testFn(test);
        }
    }
function testAllCommands ( conn , cmdMap , testFn ) { const commands = checkCommandCoverage ( conn , cmdMap ) ; for ( const command of commands ) { const test = cmdMap [ command ] ; assert ( test , "Coverage failure: must explicitly define a test for " + command ) ; if ( test . skip !== undefined ) { jsTestLog ( "Skipping " + command + ": " + test . skip ) ; continue ; } jsTestName ( "Testing " + command ) ; testFn ( test ) ; } }
The runner function for this library.
The runner function for this library .
// First check that the map contains all available commands. // Coverage already guaranteed above, but check again just in case. // Run logic specified by caller.