Last active
May 18, 2021 11:59
-
-
Save andreivasilache/20e6731f8d30236f85ff9b4f3e76126e to your computer and use it in GitHub Desktop.
[JEST] Wait for event loop to be cleared
This file contains 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
const flushEventLoop = () => new Promise(resolve => setImmediate(resolve)); | |
describe('Lorem ipsum', () => { | |
it('waits for load', async () => { | |
functionWithLotsOfMockPromises(); | |
await waitForComponentToPaint(wrapper); | |
expect(/**/).toBe(true) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment