// reports:
expect(getByText("Foo")).not.toBeInTheDocument() // as it already does
expect(queryByText("Foo")).toBeInTheDocument()
// does not report:
expect(queryByText("Foo")).not.toBeInTheDocument()
expect(getByText("Foo")).toBeInTheDocument()
In addition as discussed below in the comments, the use of get* queries inside of waitForElementToBeRemoved will no longer report an error either in a callback or directly as a parameter.
//does not report:
await waitForElementToBeRemoved(screen.getByTitle("Loading..."));
await waitForElementToBeRemoved(() => screen.getByTitle("Loading..."));