jstests/replsets/txn_override_unittests.js
/**
 * Sets that the given command should fail with the given error and the given write concern
 * error. The command will not actually be run.
 */
Sets that the given command should fail with the given error and the given write concern
error. The command will not actually be run.
Sets that the given command should fail with the given error and the given write concern error . The command will not actually be run .
function failCommandWithErrorAndWCENoRun(
    cmdName, errorCode, errorCodeName, writeConcernErrorCode, writeConcernErrorCodeName) {
    assert(!runCommandOverrideDenylistedCommands.includes(cmdName));
    cmdResponseOverrides[cmdName] = {
        responseObj: {
            ok: 0,
            code: errorCode,
            codeName: errorCodeName,
            writeConcernError: {code: writeConcernErrorCode, codeName: writeConcernErrorCodeName}
        }
    };
}
function failCommandWithErrorAndWCENoRun ( cmdName , errorCode , errorCodeName , writeConcernErrorCode , writeConcernErrorCodeName ) { assert ( ! runCommandOverrideDenylistedCommands . includes ( cmdName ) ) ; cmdResponseOverrides [ cmdName ] = { responseObj : { ok : 0 , code : errorCode , codeName : errorCodeName , writeConcernError : { code : writeConcernErrorCode , codeName : writeConcernErrorCodeName } } } ; }
Sets that the given command should fail with the given error and the given write concern
 error.
Sets that the given command should fail with the given error and the given write concern error .