In our project we do a lot of
expect(await screen.findByText('sample text')).toBeInTheDocument()
expect(await screen.findByTestId('sample test id')).toBeInTheDocument()
And recently an argument was made that we can do this instead
await screen.findByText('sample text')
await screen.findByTestId('sample test id')
because if there is no element found the test will fail anyway. We also found a small and possibly inconsistent and irrelevant improvement of run speed of a test with this change
My question is: will our tests be faster and more resource efficient if we remove all those expect calls wherever possible?