summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/shell_cmd_assertions.js
diff options
context:
space:
mode:
authorYu Jin Kang Park <yujin.kang@mongodb.com>2022-12-21 09:44:55 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-12-21 10:14:59 +0000
commit1ad63b903d3a2be8ddc29072f2996863bde32ade (patch)
treeeb95168d35b8e0946631c72c64cb372c4e4f61e5 /jstests/noPassthrough/shell_cmd_assertions.js
parentf4d70be86e77725914eea3b2c538165e62d0fc1f (diff)
downloadmongo-1ad63b903d3a2be8ddc29072f2996863bde32ade.tar.gz
SERVER-71512 Fix assert.commandWorkedOrFailedWithCode
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() {