-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: accept async functions in beforeEach/afterEach #1542
Comments
duplicate of #1256. This should be easy to implement: just overwrite beforeEach/afterEach the same way we overwrite |
please send a PR ;) |
I'll venmo/messenger 5 bucks to whomever does a good job :) In the meantime I'm using fake timers and afterEach(() => {
jest.runAllTicks();
}); |
afterEach already accepts |
it does. http://jasmine.github.io/2.5/introduction.html#section-55 |
This is already fixed in #1546 / 15.1.0. |
@DmitriiAbramov @ide ended up doing this himself, therefore paying 5 bucks to himself. |
oh. nevermind then.. still going through my jest emails from last week :) |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I'm using Aphrodite with React and Aphrodite asynchronously runs
document.querySelector("style[data-aphrodite]")
(scheduled with asap, so it uses process.nextTick). Jest seems to clean up the jsdom environment after each test so this results in an error because the tick callback runs afterdocument
has been set to undefined.So what I want to do is this:
That way each test flushes all tick callbacks and allows Aphrodite to run.
The text was updated successfully, but these errors were encountered: