Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat request: 希望提供类似nextTick的异步api以支持检查异步事件回调 #19

Open
funkyLover opened this issue Apr 2, 2019 · 1 comment

Comments

@funkyLover
Copy link

触发按钮点击会回调对应的事件回调方法,但是方法里面是异步的逻辑

希望可以在异步流程完成之后在页面元素是否正确

    const btn = comp.querySelector('.');
    reqBtn.dispatchEvent('tap', {});
    // 等待事件
    await simulate.sleep(10);
    // 这里还要等待对应的回调方法执行完成
    // 检查状态
@JuneAndGreen
Copy link
Contributor

收到反馈,后续会提供一个小程序 api 的 mock 工具,届时会考虑以 wx.nextTick 的方式提供。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants