Last active
June 7, 2022 01:02
-
-
Save ErikGMatos/51cd7dba72a66eda889e050be1359a5d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { waitFor, screen } from '@testing-library/react'; | |
describe('Component X', async () => { | |
it('should render the component and to wait for something', async () => { | |
// to mount the component | |
// here you wait for some element/text | |
await waitFor(() => { | |
expect(screen.getByText('some string')).toBeInTheDocument(); | |
}, { | |
timeout: 5000 // miliseconds | |
}) | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment