Details
-
Bug
-
Resolution: Unresolved
-
Major - P3
-
None
-
None
-
None
-
None
-
Server Tooling & Methods
-
ALL
-
Description
assert.commandWorkedOrFailedWithCode() calls assert.commandWorked() if a command result has "ok : 1" field or assert.commandFailedWithCode() if not.
In the case of a write error, where the response has both "ok: 1" and one or more errors reported in a "writeErrors" subdocument, assert.commandWorked() will be called which then asserts when the write error is encountered, regardless of whether the code is in the set passed to assert.commandWorkedOrFailedWithCode().