refute_has doesn't block (for async code) #587
Unanswered
jonleighton
asked this question in
Q&A
Replies: 2 comments 8 replies
-
I believe it is deliberate, but it was written before my time. I think there has been discussion to deprecate the function entirely in favor of the method you provided, but I believe that discussion is all it's been. |
Beta Was this translation helpful? Give feedback.
4 replies
-
Would a PR fixing this be accepted? @mhanberg |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wrote a test like this:
The element is becomes hidden via JS executing on the page.
My expectation was that if the element was present when
refute_has
first runs, it would wait for the async timeout and keep testing the DOM before raising an error. This turns out not to be true, which lead to flakey test failures.We can do this instead:
But I find the behaviour of
refute_has
surprising. Is this deliberate? If not, perhaps it can be changed?Beta Was this translation helpful? Give feedback.
All reactions