summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/shell_cmd_assertions.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthrough/shell_cmd_assertions.js')
-rw-r--r--jstests/noPassthrough/shell_cmd_assertions.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/jstests/noPassthrough/shell_cmd_assertions.js b/jstests/noPassthrough/shell_cmd_assertions.js
index cfb5e4fceca..ccd864d0a38 100644
--- a/jstests/noPassthrough/shell_cmd_assertions.js
+++ b/jstests/noPassthrough/shell_cmd_assertions.js
@@ -94,8 +94,7 @@ tests.push(function rawCommandWriteOk() {
assert.doesNotThrow(() => assert.commandWorkedIgnoringWriteErrors(res));
assert.throws(() => assert.commandFailed(res));
assert.throws(() => assert.commandFailedWithCode(res, 0));
- assert.doesNotThrow(
- () => assert.commandWorkedOrFailedWithCode(res, 0, "threw even though succeeded"));
+ assert.doesNotThrow(() => assert.commandWorkedOrFailedWithCode(res, 0));
});
tests.push(function rawCommandWriteErr() {
@@ -106,9 +105,9 @@ tests.push(function rawCommandWriteErr() {
assert.doesNotThrow(() => assert.commandFailedWithCode(res, ErrorCodes.DuplicateKey));
assert.doesNotThrow(
() => assert.commandFailedWithCode(res, [ErrorCodes.DuplicateKey, kFakeErrCode]));
- assert.throws(
+ assert.doesNotThrow(
() => assert.commandWorkedOrFailedWithCode(
- res, [ErrorCodes.DuplicateKey, kFakeErrCode], "expected to throw on write error"));
+ res, [ErrorCodes.DuplicateKey, kFakeErrCode], "expected a write failure"));
assert.throws(() => assert.commandWorkedOrFailedWithCode(
res, [kFakeErrCode], "expected to throw on write error"));
});
@@ -140,8 +139,8 @@ tests.push(function collMultiInsertWriteOk() {
assert.doesNotThrow(() => assert.commandWorkedIgnoringWriteErrors(res));
assert.throws(() => assert.commandFailed(res));
assert.throws(() => assert.commandFailedWithCode(res, 0));
- assert.throws(() =>
- assert.commandWorkedOrFailedWithCode(res, 0, "threw even though succeeded"));
+ assert.doesNotThrow(
+ () => assert.commandWorkedOrFailedWithCode(res, 0, "threw even though succeeded"));
});
tests.push(function collMultiInsertWriteErr() {