Open make-github-pseudonymous-again opened 2 years ago
This contradicts the documented behavior:
The documentation is contradicting itself already. It only says that it'll throw on null
or empty arrays. But it doesn't say that () => null
will throw. However, it later includes waitForElementToBeRemoved(() => getByText(/not here/i))
in the examples.
So documentation should be clarified as well.
@testing-library/dom
version: 8.11.2Problem description:
There is currently no exception catching for the initial call inside
waitForElementToBeRemoved
. When that call ofcallback
throws, instead of getting the errorError('The element(s) given to waitForElementToBeRemoved are already removed...')
we will get the error thrown from the callback, even when it is aTestingLibraryElementError
. This contradicts the documented behavior:Suggested solution:
See #1094.