function filterShim(callback, cond, skipMessage) {
  return async () => {
    const val = await cond();
    if (!val) {
      if (skipMessage) {
        pending(skipMessage);
      }
      return;
    }

    if (callback.length) {
      // If this has a done callback, wrap in a Promise so we can await it.
      await new Promise((resolve) => callback(resolve));
    } else {
      // If this is an async test, this will wait for it to complete; if this
      // is a synchronous test, await will do nothing.
      await callback();
    }
  };
}
Returns a Jasmine callback which shims the real callback and checks for
a certain condition.  The test will only be run if the condition is true.

@param {jasmine.Callback} callback  The test callback.
@param {function():*} cond
@param {?string} skipMessage  The message used when skipping a test; or
  null to not use pending().  This should only be null for before/after
  blocks.
@return {jasmine.Callback}