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