You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Like fireEvent it would be useful if the functions from the @testing-library/user-event package would also call await tick underneath the hood to make the tests run reliably and to avoid calling await tick manually.
Propsed solution:
Export a modified version of user-event inside the @testing-library/svelte package like so:
import{userEvent}from"@testing-library/svelte";
The text was updated successfully, but these errors were encountered:
Not to be a killjoy, but I think I'll close this one for now. I don't want to add a dependency to @testing-library/user-event that a fair percentage of users won't need, and make assumptions on how people use tick() versus waitFor() (mostly considering the latter one is probably safer).
This being said, if anybody want to tag that await tick() at the end of function calls, that should be doable via (:warning: untested):
const user = userEvent.setup();
Object.keys(user).forEach( method => {
const orig = user[method];
user[method] = async (...args) => { const result = orig(...args); await tick(); return result }
});
Like
fireEvent
it would be useful if the functions from the@testing-library/user-event
package would also callawait tick
underneath the hood to make the tests run reliably and to avoid callingawait tick
manually.Propsed solution:
Export a modified version of
user-event
inside the@testing-library/svelte
package like so:The text was updated successfully, but these errors were encountered: