-
Notifications
You must be signed in to change notification settings - Fork 26.2k
feat(core): rename async to waitForAsync to avoid confusing #37583
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-for: fw-upgrade
Don't forget to update: https://github.com/angular/angular/blob/efdf347f9c04e19c8c4fa8b8c05f4310f42728d5/aio/content/guide/upgrade-setup.md
Otherwise LGTM
And I believe you are also going to rename fakeAsync()
too.
Can you provide some details on when a developer would need to use this:
instead of this:
|
@JiaLiPassion I'm personally missing some context on this; is this something that's been previously proposed/discussed with the larger team? |
@jelbourn, there is no discussion about this one, I just want to make a proposal by making this PR so it may easier to review and discuss. And yeah, I think we need to discuss this one first otherwise it may cause confusion to the community. I will close this PR for now, thank you. |
1040b87
to
bee367a
Compare
8e8929c
to
f494e53
Compare
You can preview f494e53 at https://pr37583-f494e53.ngbuilds.io/. |
Thanks for the consideration everyone! good job @JiaLiPassion ! 💗 |
@petebacondarwin , yeah, I updated the format and commit again, please review, thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-for: fw-upgrade
f494e53
to
4a63d18
Compare
You can preview 4a63d18 at https://pr37583-4a63d18.ngbuilds.io/. |
4a63d18
to
a0d0dce
Compare
You can preview a0d0dce at https://pr37583-a0d0dce.ngbuilds.io/. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
- Sorry to be a pain, but could you break the PR into two. One for the change, and one to move
async
towaitForAsync
We had it broken up but somehow it gote merged.
Reviewed-for: global-approvers
Reviewed-for: fw-core
a0d0dce
to
804213c
Compare
@angular/core/testing provide `async` test utility, but the name `async` is confusing with the javascript keyword `async`. And in some test case, if you want to use both the `async` from `@angular/core/testing` and `async/await`, you may have to write the code like this. ```typescript it('test async operations', async(async() => { const result = await asyncMethod(); expect(result).toEqual('expected'); })); ``` So in this PR, the `async` is renamed to `waitForAsync` and also deprecate `async`.
The last commit change `async` to `waitForAsync`. This commit update all usages in the code and also update aio doc.
804213c
to
e20abd9
Compare
You can preview e20abd9 at https://pr37583-e20abd9.ngbuilds.io/. |
merge-assistance: global-approval |
…37583) @angular/core/testing provide `async` test utility, but the name `async` is confusing with the javascript keyword `async`. And in some test case, if you want to use both the `async` from `@angular/core/testing` and `async/await`, you may have to write the code like this. ```typescript it('test async operations', async(async() => { const result = await asyncMethod(); expect(result).toEqual('expected'); })); ``` So in this PR, the `async` is renamed to `waitForAsync` and also deprecate `async`. PR Close angular#37583
angular#37583) The last commit change `async` to `waitForAsync`. This commit update all usages in the code and also update aio doc. PR Close angular#37583
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
@angular/core/testing provide
async
test utility, but the nameasync
isconfusing with the javascript keyword
async
. And in some test case, if youwant to use both the
async
from@angular/core/testing
andasync/await
,you may have to write the code like this.
So in this PR, the
async
is renamed toasyncTest
.PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information