code: function scroll(comp, destOffset = 0, times = 20, propName = 'scrollTop') {
    if (!comp || !comp.dom) throw new Error('invalid params')
    if (typeof times !== 'number' || times <= 0) times = 1
  
    destOffset = destOffset < 0 ? 0 : destOffset
  
    const dom = comp.dom
    const delta = destOffset - dom[propName]
    // eslint-disable-next-line no-bitwise
    const unit = ~~(delta / times)
    const env = _.getEnv()
  
    if (env === 'nodejs') {
      for (let i = 0; i < times; i++) {
        // nodejs 环境
        setTimeout(() => {
          if (i === times - 1) dom[propName] = destOffset
          else dom[propName] += unit
  
          // 模拟异步触发
          dom.dispatchEvent(new Event('scroll', {bubbles: true, cancelable: false}))
        }, 0)
      }
    } else {
      // 浏览器
      dom[propName] = destOffset
    }
  }
docs: 模拟滚动