Generalize assert methods in JavaScript tests

    • DevProd Correctness
    • Correctness 2025-07-14, Correctness 2025-07-28
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      We have too many different assert methods in our JavaScript end-to-end tests. The number can be reduced by generalizing some of the methods.

      For instance, assert.dropExceptionsWithCode(func, dropCodes, onDrop) can be expressed through a generalized assert.doesNotThrow(func, params, ignoreErrorCodes, msg).

      Another example: assert.commandWorkedOrFailedWithCode(res, errorCodeSet, msg) can be expressed through a generalized assert.commandWorked(res, msg, ignoreErrorCodes).

            Assignee:
            Steve McClure
            Reporter:
            Romans Kasperovics
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: