Calls an API repeatedly until its body meets a condition. Non-2xx responses count as
"not yet" and are retried. Fails the test if the condition isn't met within the timeout.
// Posts.getPost is declared as this.get<Post>(...), so body is a Post constpost = awaitpollUntil( () =>Posts.getPost(id), (body) =>body.status === "published", { message:"post to be published" } );
Calls an API repeatedly until its body meets a condition. Non-2xx responses count as "not yet" and are retried. Fails the test if the condition isn't met within the timeout.