-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Fully Compatible
-
Query Execution 2021-05-31, Query Execution 2021-06-14, Query Execution 2021-06-28
We have a helperĀ assert.throws() which returns the error which was thrown. A common pattern looks like this:
let err = assert.throws(() => coll.aggregate(...));
assert.eq(err.code, expectedCode);
We should add a helper to the assertion library to condense this and simplify some of our tests. It will be a good counterpart to assert.commandFailedWithCode.