function getAndExpectError(navigationError, context) {
    const error = getPageLoadError(navigationError, context);
    if (!error) throw new Error('expected a page load error');
    return error;
  }
@param {LH.LighthouseError|undefined} navigationError
@param {Parameters<typeof getPageLoadError>[1]} context