function withAssertionFailure(f) {
  assertThrows(f);
  asserts.setErrorHandler((error) => {});
  try {
    return f();
  } finally {
    asserts.setErrorHandler(asserts.DEFAULT_ERROR_HANDLER);
  }
}
Tests that f raises an AssertionError and runs f while disabling assertion
errors.
@param {function():*} f function with a failing assertion.
@return {*} the return value of f.