mzgoddard / preact-render-spy

Render preact components with access to the produced virtual dom for testing.

Home Page:https://www.npmjs.com/package/preact-render-spy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use preact `rerender` after simulate instead?

gnarf opened this issue · comments

return new Promise(resolve => setTimeout(resolve, 0));

This timeout seems really arbitrary, and what if you have fake timers going or something?

We could instead use preact.rerender which will render all dirty items in the queue: https://github.com/developit/preact/blob/d213b086e36e0ec3c4700d36a5e6a3368af74894/src/render-queue.js#L15