-
Notifications
You must be signed in to change notification settings - Fork 310
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
Getting "done is not a function" errors when updating to 8.1.0 #356
Comments
Can you provide an example of your test? |
The code below works fine on 8.0.0 but errors on 8.1.0. There were others, but I got rid of unnecessary uses of done, but I need to use it here.
|
@JiaLiPassion can you have a quick look at this? jest-preset-angular/src/zone-patch/index.js Lines 51 to 53 in 7c72e93
to jest-preset-angular/src/zone-patch/index.js Lines 51 to 53 in 17dc5bf
While I personally would not mix promises and done, but prefer a test as follows, still we should support these kind of tests. fixture.detectChanges();
await fixture.whenStable()
expect(activatedEventSpy).toHaveBeenCalled();
expect(setTitleSpy).toHaveBeenCalledWith('Home');
expect(setTitleServiceSpy).toHaveBeenCalled(); |
@wtho, sure, Got it, I will check it now. |
probably related to changes in
8.1.0 |
Yeah, I know where the problem is, will need to find out how to fix it, because revert to original logic
will not support the case like this.
|
Ok, I know how to fix this one, will create a PR now. |
Awesome! |
@qdouble can you please confirm this is resolved in v8.1.1? |
@wtho it appears to work just fine now, thanks. |
@wtho This issue reemerged can you please reopen this issue? |
with Jest 27, default test runner is |
Downgrading back to 8.0.0 removes the error, so there is something in this update that is causing done() not be recognized as a function in any of my spec files.
The text was updated successfully, but these errors were encountered: