code: function asCheckedCallback(promise, cb, useOwnMethod) {
    let called = false;
    if (useOwnMethod) {
      promise.asCallback(after);
    } else {
      asCallback(promise, after);
    }
  
    function after() {
      expect(called).toBeFalsy();
      called = true;
      return cb.apply(this, arguments);
    }
  }
docs: Wrap the asCallback function with a check that ensures the callback is never called twice.